close Warning: Can't synchronize with repository "(default)" (The repository directory has changed, you should resynchronize the repository with: trac-admin $ENV repository resync '(default)'). Look in the Trac log for more information.

source: branches/f4grobner/gb-postprocessing.lisp@ 134

Last change on this file since 134 was 134, checked in by Marek Rychlik, 9 years ago

* empty log message *

File size: 2.6 KB
Line 
1;;; -*- Mode: Lisp; Package: Maxima; Syntax: Common-Lisp; Base: 10 -*-
2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3;;;
4;;; Copyright (C) 1999, 2002, 2009, 2015 Marek Rychlik <rychlik@u.arizona.edu>
5;;;
6;;; This program is free software; you can redistribute it and/or modify
7;;; it under the terms of the GNU General Public License as published by
8;;; the Free Software Foundation; either version 2 of the License, or
9;;; (at your option) any later version.
10;;;
11;;; This program is distributed in the hope that it will be useful,
12;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
13;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14;;; GNU General Public License for more details.
15;;;
16;;; You should have received a copy of the GNU General Public License
17;;; along with this program; if not, write to the Free Software
18;;; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19;;;
20;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
21
22
23;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
24;;
25;; Standard postprocessing of Grobner bases:
26;; - reduction
27;; - minimization
28;;
29;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
30
31(defun reduction (ring plist)
32 "Reduce a list of polynomials PLIST, so that non of the terms in any of
33the polynomials is divisible by a leading monomial of another
34polynomial. Return the reduced list."
35 (do ((q plist)
36 (found t))
37 ((not found)
38 (mapcar #'(lambda (x) (poly-primitive-part ring x)) q))
39 ;;Find p in Q such that p is reducible mod Q\{p}
40 (setf found nil)
41 (dolist (x q)
42 (let ((q1 (remove x q)))
43 (multiple-value-bind (h c div-count)
44 (normal-form ring x q1 nil #| not a top reduction! |# )
45 (declare (ignore c))
46 (unless (zerop div-count)
47 (setf found t q q1)
48 (unless (poly-zerop h)
49 (setf q (nconc q1 (list h))))
50 (return)))))))
51
52(defun minimization (p)
53 "Returns a sublist of the polynomial list P spanning the same
54monomial ideal as P but minimal, i.e. no leading monomial
55of a polynomial in the sublist divides the leading monomial
56of another polynomial."
57 (do ((q p)
58 (found t))
59 ((not found) q)
60 ;;Find p in Q such that lm(p) is in LM(Q\{p})
61 (setf found nil
62 q (dolist (x q q)
63 (let ((q1 (remove x q)))
64 (when (member-if #'(lambda (p) (monom-divides-p (poly-lm x) (poly-lm p))) q1)
65 (setf found t)
66 (return q1)))))))
Note: See TracBrowser for help on using the repository browser.