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/mx-grobner.lisp@ 1649

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

* empty log message *

File size: 19.0 KB
Line 
1;;; -*- Mode: Lisp -*-
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;; Load this file into Maxima to bootstrap the Grobner package.
25;; NOTE: This file does use symbols defined by Maxima, so it
26;; will not work when loaded in Common Lisp.
27;;
28;; DETAILS: This file implements an interface between the Grobner
29;; basis package NGROBNER, which is a pure Common Lisp package, and
30;; Maxima. NGROBNER for efficiency uses its own representation of
31;; polynomials. Thus, it is necessary to convert Maxima representation
32;; to the internal representation and back. The facilities to do so
33;; are implemented in this file.
34;;
35;; Also, since the NGROBNER package consists of many Lisp files, it is
36;; necessary to load the files. It is possible and preferrable to use
37;; ASDF for this purpose. The default is ASDF. It is also possible to
38;; simply used LOAD and COMPILE-FILE to accomplish this task.
39;;
40;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
41
42(in-package :maxima)
43
44(macsyma-module cgb-maxima)
45
46
47(eval-when
48 #+gcl (load eval)
49 #-gcl (:load-toplevel :execute)
50 (format t "~&Loading maxima-grobner ~a ~a~%"
51 "$Revision: 2.0 $" "$Date: 2015/06/02 0:34:17 $"))
52
53;;FUNCTS is loaded because it contains the definition of LCM
54($load "functs")
55#+sbcl(progn (require 'asdf) (load "ngrobner.asd")(asdf:load-system :ngrobner))
56
57(use-package :ngrobner)
58
59
60;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
61;;
62;; Maxima expression ring
63;;
64;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
65;;
66;; This is how we perform operations on coefficients
67;; using Maxima functions.
68;;
69;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
70
71(defparameter *maxima-ring*
72 (make-ring
73 ;;(defun coeff-zerop (expr) (meval1 `(($is) (($equal) ,expr 0))))
74 :parse #'(lambda (expr)
75 (when modulus (setf expr ($rat expr)))
76 expr)
77 :unit #'(lambda () (if modulus ($rat 1) 1))
78 :zerop #'(lambda (expr)
79 ;;When is exactly a maxima expression equal to 0?
80 (cond ((numberp expr)
81 (= expr 0))
82 ((atom expr) nil)
83 (t
84 (case (caar expr)
85 (mrat (eql ($ratdisrep expr) 0))
86 (otherwise (eql ($totaldisrep expr) 0))))))
87 :add #'(lambda (x y) (m+ x y))
88 :sub #'(lambda (x y) (m- x y))
89 :uminus #'(lambda (x) (m- x))
90 :mul #'(lambda (x y) (m* x y))
91 ;;(defun coeff-div (x y) (cadr ($divide x y)))
92 :div #'(lambda (x y) (m// x y))
93 :lcm #'(lambda (x y) (meval1 `((|$LCM|) ,x ,y)))
94 :ezgcd #'(lambda (x y) (apply #'values (cdr ($ezgcd ($totaldisrep x) ($totaldisrep y)))))
95 ;; :gcd #'(lambda (x y) (second ($ezgcd x y)))))
96 :gcd #'(lambda (x y) ($gcd x y))))
97
98;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
99;;
100;; Maxima expression parsing
101;;
102;;
103;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
104;;
105;; Functions and macros dealing with internal representation
106;; structure.
107;;
108;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
109
110(defun equal-test-p (expr1 expr2)
111 (alike1 expr1 expr2))
112
113(defun coerce-maxima-list (expr)
114 "Convert a Maxima list to Lisp list."
115 (cond
116 ((and (consp (car expr)) (eql (caar expr) 'mlist)) (cdr expr))
117 (t expr)))
118
119(defun free-of-vars (expr vars) (apply #'$freeof `(,@vars ,expr)))
120
121;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
122;;
123;; Order utilities
124;;
125;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
126
127(defun find-ring (ring)
128 "This function returns the ring structure bases on input symbol."
129 (cond
130 ((null ring) nil)
131 ((symbolp ring)
132 (case ring
133 ((maxima-ring :maxima-ring #:maxima-ring $expression_ring #:expression_ring) *maxima-ring*)
134 ((ring-of-integers :ring-of-integers #:ring-of-integers $ring_of_integers) *ring-of-integers*)
135 (otherwise
136 (mtell "~%Warning: Ring ~M not found. Using default.~%" ring))))
137 (t
138 (mtell "~%Ring specification ~M is not recognized. Using default.~%" ring)
139 nil)))
140
141(defun find-order (order)
142 "This function returns the order function bases on its name."
143 (cond
144 ((null order) nil)
145 ((symbolp order)
146 (case order
147 ((lex :lex $lex #:lex)
148 #'lex>)
149 ((grlex :grlex $grlex #:grlex)
150 #'grlex>)
151 ((grevlex :grevlex $grevlex #:grevlex)
152 #'grevlex>)
153 ((invlex :invlex $invlex #:invlex)
154 #'invlex>)
155 (otherwise
156 (mtell "~%Warning: Order ~M not found. Using default.~%" order))))
157 (t
158 (mtell "~%Order specification ~M is not recognized. Using default.~%" order)
159 nil)))
160
161(defun maxima->poly (expr vars
162 &optional
163 (ring $poly_coefficient_ring)
164 (order $poly_monomial_order)
165 &aux
166 (vars (coerce-maxima-list vars))
167 (ring-and-order (make-ring-and-order (find-ring) (find-order))))
168 "Convert a maxima polynomial expression EXPR in variables VARS to internal form."
169 (labels ((parse (arg) (maxima->poly arg vars))
170 (parse-list (args) (mapcar #'parse args)))
171 (cond
172 ((eql expr 0) (make-poly-zero))
173 ((member expr vars :test #'equal-test-p)
174 (let ((pos (position expr vars :test #'equal-test-p)))
175 (make-variable *maxima-ring* (length vars) pos)))
176 ((free-of-vars expr vars)
177 ;;This means that variable-free CRE and Poisson forms will be converted
178 ;;to coefficients intact
179 (coerce-coeff *maxima-ring* expr vars))
180 (t
181 (case (caar expr)
182 (mplus (reduce #'(lambda (x y) (poly-add *maxima-ring* x y)) (parse-list (cdr expr))))
183 (mminus (poly-uminus *maxima-ring* (parse (cadr expr))))
184 (mtimes
185 (if (endp (cddr expr)) ;unary
186 (parse (cdr expr))
187 (reduce #'(lambda (p q) (poly-mul *maxima-ring* p q)) (parse-list (cdr expr)))))
188 (mexpt
189 (cond
190 ((member (cadr expr) vars :test #'equal-test-p)
191 ;;Special handling of (expt var pow)
192 (let ((pos (position (cadr expr) vars :test #'equal-test-p)))
193 (make-variable *maxima-ring* (length vars) pos (caddr expr))))
194 ((not (and (integerp (caddr expr)) (plusp (caddr expr))))
195 ;; Negative power means division in coefficient ring
196 ;; Non-integer power means non-polynomial coefficient
197 (mtell "~%Warning: Expression ~%~M~%contains power which is not a positive integer. Parsing as coefficient.~%"
198 expr)
199 (coerce-coeff *maxima-ring* expr vars))
200 (t (poly-expt *maxima-ring* (parse (cadr expr)) (caddr expr)))))
201 (mrat (parse ($ratdisrep expr)))
202 (mpois (parse ($outofpois expr)))
203 (otherwise
204 (coerce-coeff *maxima-ring* expr vars)))))))
205
206#|
207
208(defun parse-poly-list (expr vars)
209 "Parse a Maxima representation of a list of polynomials."
210 (case (caar expr)
211 (mlist (mapcar #'(lambda (p) (parse-poly p vars)) (cdr expr)))
212 (t (merror "Expression ~M is not a list of polynomials in variables ~M."
213 expr vars))))
214
215(defun parse-poly-list-list (poly-list-list vars)
216 "Parse a Maxima representation of a list of lists of polynomials."
217 (mapcar #'(lambda (g) (parse-poly-list g vars)) (coerce-maxima-list poly-list-list)))
218
219
220;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
221;;
222;; Conversion from internal form to Maxima general form
223;;
224;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
225
226(defun maxima-head ()
227 (if $poly_return_term_list
228 '(mlist)
229 '(mplus)))
230
231(defun coerce-to-maxima (poly-type object vars)
232 (case poly-type
233 (:polynomial
234 `(,(maxima-head) ,@(mapcar #'(lambda (term) (coerce-to-maxima :term term vars)) (poly-termlist object))))
235 (:poly-list
236 `((mlist) ,@(mapcar #'(lambda (p) (funcall *ratdisrep-fun* (coerce-to-maxima :polynomial p vars))) object)))
237 (:term
238 `((mtimes) ,(funcall *ratdisrep-fun* (term-coeff object))
239 ,@(mapcar #'(lambda (var power) `((mexpt) ,var ,power))
240 vars (coerce (term-monom object) 'list))))
241 ;; Assumes that Lisp and Maxima logicals coincide
242 (:logical object)
243 (otherwise
244 object)))
245
246
247;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
248;;
249;; Unary and binary operation definition facility
250;;
251;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
252
253(defmacro define-unop (maxima-name fun-name
254 &optional (documentation nil documentation-supplied-p))
255 "Define a MAXIMA-level unary operator MAXIMA-NAME corresponding to unary function FUN-NAME."
256 `(defun ,maxima-name (p vars
257 &aux
258 (vars (coerce-maxima-list vars))
259 (p (parse-poly p vars)))
260 ,@(when documentation-supplied-p (list documentation))
261 (coerce-to-maxima :polynomial (,fun-name *maxima-ring* p) vars)))
262
263(defmacro define-binop (maxima-name fun-name
264 &optional (documentation nil documentation-supplied-p))
265 "Define a MAXIMA-level binary operator MAXIMA-NAME corresponding to binary function FUN-NAME."
266 `(defmfun ,maxima-name (p q vars
267 &aux
268 (vars (coerce-maxima-list vars))
269 (p (parse-poly p vars))
270 (q (parse-poly q vars)))
271 ,@(when documentation-supplied-p (list documentation))
272 (coerce-to-maxima :polynomial (,fun-name *maxima-ring* p q) vars)))
273
274
275;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
276;;
277;; Facilities for evaluating Grobner package expressions
278;; within a prepared environment
279;;
280;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
281
282(defmacro with-monomial-order ((order) &body body)
283 "Evaluate BODY with monomial order set to ORDER."
284 `(let ((*monomial-order* (or (find-order ,order) *monomial-order*)))
285 . ,body))
286
287(defmacro with-coefficient-ring ((ring) &body body)
288 "Evaluate BODY with coefficient ring set to RING."
289 `(let ((*maxima-ring* (or (find-ring ,ring) *maxima-ring*)))
290 . ,body))
291
292(defmacro with-ring-and-order ((ring order) &body body)
293 "Evaluate BODY with monomial order set to ORDER and coefficient ring set to RING."
294 `(let ((*monomial-order* (or (find-order ,order) *monomial-order*))
295 (*maxima-ring* (or (find-ring ,ring) *maxima-ring*)))
296 . ,body))
297
298(defmacro with-elimination-orders ((primary secondary elimination-order)
299 &body body)
300 "Evaluate BODY with primary and secondary elimination orders set to PRIMARY and SECONDARY."
301 `(let ((*primary-elimination-order* (or (find-order ,primary) *primary-elimination-order*))
302 (*secondary-elimination-order* (or (find-order ,secondary) *secondary-elimination-order*))
303 (*elimination-order* (or (find-order ,elimination-order) *elimination-order*)))
304 . ,body))
305
306
307;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
308;;
309;; Maxima-level interface functions
310;;
311;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
312
313;; Auxillary function for removing zero polynomial
314(defun remzero (plist) (remove #'poly-zerop plist))
315
316;;Simple operators
317
318(define-binop $poly_add poly-add
319 "Adds two polynomials P and Q")
320
321(define-binop $poly_subtract poly-sub
322 "Subtracts a polynomial Q from P.")
323
324(define-binop $poly_multiply poly-mul
325 "Returns the product of polynomials P and Q.")
326
327(define-binop $poly_s_polynomial spoly
328 "Returns the syzygy polynomial (S-polynomial) of two polynomials P and Q.")
329
330(define-unop $poly_primitive_part poly-primitive-part
331 "Returns the polynomial P divided by GCD of its coefficients.")
332
333(define-unop $poly_normalize poly-normalize
334 "Returns the polynomial P divided by the leading coefficient.")
335
336;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
337;;
338;; Macro facility for writing Maxima-level wrappers for
339;; functions operating on internal representation
340;;
341;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
342
343(defmacro with-parsed-polynomials (((maxima-vars &optional (maxima-new-vars nil new-vars-supplied-p))
344 &key (polynomials nil)
345 (poly-lists nil)
346 (poly-list-lists nil)
347 (value-type nil))
348 &body body
349 &aux (vars (gensym))
350 (new-vars (gensym)))
351 `(let ((,vars (coerce-maxima-list ,maxima-vars))
352 ,@(when new-vars-supplied-p
353 (list `(,new-vars (coerce-maxima-list ,maxima-new-vars)))))
354 (coerce-to-maxima
355 ,value-type
356 (with-coefficient-ring ($poly_coefficient_ring)
357 (with-monomial-order ($poly_monomial_order)
358 (with-elimination-orders ($poly_primary_elimination_order
359 $poly_secondary_elimination_order
360 $poly_elimination_order)
361 (let ,(let ((args nil))
362 (dolist (p polynomials args)
363 (setf args (cons `(,p (parse-poly ,p ,vars)) args)))
364 (dolist (p poly-lists args)
365 (setf args (cons `(,p (parse-poly-list ,p ,vars)) args)))
366 (dolist (p poly-list-lists args)
367 (setf args (cons `(,p (parse-poly-list-list ,p ,vars)) args))))
368 . ,body))))
369 ,(if new-vars-supplied-p
370 `(append ,vars ,new-vars)
371 vars))))
372
373
374;;Functions
375
376(defmfun $poly_expand (p vars)
377 "This function is equivalent to EXPAND(P) if P parses correctly to a polynomial.
378If the representation is not compatible with a polynomial in variables VARS,
379the result is an error."
380 (with-parsed-polynomials ((vars) :polynomials (p)
381 :value-type :polynomial)
382 p))
383
384(defmfun $poly_expt (p n vars)
385 (with-parsed-polynomials ((vars) :polynomials (p) :value-type :polynomial)
386 (poly-expt *maxima-ring* p n)))
387
388(defmfun $poly_content (p vars)
389 (with-parsed-polynomials ((vars) :polynomials (p))
390 (poly-content *maxima-ring* p)))
391
392(defmfun $poly_pseudo_divide (f fl vars
393 &aux (vars (coerce-maxima-list vars))
394 (f (parse-poly f vars))
395 (fl (parse-poly-list fl vars)))
396 (multiple-value-bind (quot rem c division-count)
397 (poly-pseudo-divide *maxima-ring* f fl)
398 `((mlist)
399 ,(coerce-to-maxima :poly-list quot vars)
400 ,(coerce-to-maxima :polynomial rem vars)
401 ,c
402 ,division-count)))
403
404(defmfun $poly_exact_divide (f g vars)
405 (with-parsed-polynomials ((vars) :polynomials (f g) :value-type :polynomial)
406 (poly-exact-divide *maxima-ring* f g)))
407
408(defmfun $poly_normal_form (f fl vars)
409 (with-parsed-polynomials ((vars) :polynomials (f)
410 :poly-lists (fl)
411 :value-type :polynomial)
412 (normal-form *maxima-ring* f (remzero fl) nil)))
413
414(defmfun $poly_buchberger_criterion (g vars)
415 (with-parsed-polynomials ((vars) :poly-lists (g) :value-type :logical)
416 (buchberger-criterion *maxima-ring* g)))
417
418(defmfun $poly_buchberger (fl vars)
419 (with-parsed-polynomials ((vars) :poly-lists (fl) :value-type :poly-list)
420 (buchberger *maxima-ring* (remzero fl) 0 nil)))
421
422(defmfun $poly_reduction (plist vars)
423 (with-parsed-polynomials ((vars) :poly-lists (plist)
424 :value-type :poly-list)
425 (reduction *maxima-ring* plist)))
426
427(defmfun $poly_minimization (plist vars)
428 (with-parsed-polynomials ((vars) :poly-lists (plist)
429 :value-type :poly-list)
430 (minimization plist)))
431
432(defmfun $poly_normalize_list (plist vars)
433 (with-parsed-polynomials ((vars) :poly-lists (plist)
434 :value-type :poly-list)
435 (poly-normalize-list *maxima-ring* plist)))
436
437(defmfun $poly_grobner (f vars)
438 (with-parsed-polynomials ((vars) :poly-lists (f)
439 :value-type :poly-list)
440 (grobner *maxima-ring* (remzero f))))
441
442(defmfun $poly_reduced_grobner (f vars)
443 (with-parsed-polynomials ((vars) :poly-lists (f)
444 :value-type :poly-list)
445 (reduced-grobner *maxima-ring* (remzero f))))
446
447(defmfun $poly_depends_p (p var mvars
448 &aux (vars (coerce-maxima-list mvars))
449 (pos (position var vars)))
450 (if (null pos)
451 (merror "~%Variable ~M not in the list of variables ~M." var mvars)
452 (poly-depends-p (parse-poly p vars) pos)))
453
454(defmfun $poly_elimination_ideal (flist k vars)
455 (with-parsed-polynomials ((vars) :poly-lists (flist)
456 :value-type :poly-list)
457 (elimination-ideal *maxima-ring* flist k nil 0)))
458
459(defmfun $poly_colon_ideal (f g vars)
460 (with-parsed-polynomials ((vars) :poly-lists (f g) :value-type :poly-list)
461 (colon-ideal *maxima-ring* f g nil)))
462
463(defmfun $poly_ideal_intersection (f g vars)
464 (with-parsed-polynomials ((vars) :poly-lists (f g) :value-type :poly-list)
465 (ideal-intersection *maxima-ring* f g nil)))
466
467(defmfun $poly_lcm (f g vars)
468 (with-parsed-polynomials ((vars) :polynomials (f g) :value-type :polynomial)
469 (poly-lcm *maxima-ring* f g)))
470
471(defmfun $poly_gcd (f g vars)
472 ($first ($divide (m* f g) ($poly_lcm f g vars))))
473
474(defmfun $poly_grobner_equal (g1 g2 vars)
475 (with-parsed-polynomials ((vars) :poly-lists (g1 g2))
476 (grobner-equal *maxima-ring* g1 g2)))
477
478(defmfun $poly_grobner_subsetp (g1 g2 vars)
479 (with-parsed-polynomials ((vars) :poly-lists (g1 g2))
480 (grobner-subsetp *maxima-ring* g1 g2)))
481
482(defmfun $poly_grobner_member (p g vars)
483 (with-parsed-polynomials ((vars) :polynomials (p) :poly-lists (g))
484 (grobner-member *maxima-ring* p g)))
485
486(defmfun $poly_ideal_saturation1 (f p vars)
487 (with-parsed-polynomials ((vars) :poly-lists (f) :polynomials (p)
488 :value-type :poly-list)
489 (ideal-saturation-1 *maxima-ring* f p 0)))
490
491(defmfun $poly_saturation_extension (f plist vars new-vars)
492 (with-parsed-polynomials ((vars new-vars)
493 :poly-lists (f plist)
494 :value-type :poly-list)
495 (saturation-extension *maxima-ring* f plist)))
496
497(defmfun $poly_polysaturation_extension (f plist vars new-vars)
498 (with-parsed-polynomials ((vars new-vars)
499 :poly-lists (f plist)
500 :value-type :poly-list)
501 (polysaturation-extension *maxima-ring* f plist)))
502
503(defmfun $poly_ideal_polysaturation1 (f plist vars)
504 (with-parsed-polynomials ((vars) :poly-lists (f plist)
505 :value-type :poly-list)
506 (ideal-polysaturation-1 *maxima-ring* f plist 0 nil)))
507
508(defmfun $poly_ideal_saturation (f g vars)
509 (with-parsed-polynomials ((vars) :poly-lists (f g)
510 :value-type :poly-list)
511 (ideal-saturation *maxima-ring* f g 0 nil)))
512
513(defmfun $poly_ideal_polysaturation (f ideal-list vars)
514 (with-parsed-polynomials ((vars) :poly-lists (f)
515 :poly-list-lists (ideal-list)
516 :value-type :poly-list)
517 (ideal-polysaturation *maxima-ring* f ideal-list 0 nil)))
518
519(defmfun $poly_lt (f vars)
520 (with-parsed-polynomials ((vars) :polynomials (f) :value-type :polynomial)
521 (make-poly-from-termlist (list (poly-lt f)))))
522
523(defmfun $poly_lm (f vars)
524 (with-parsed-polynomials ((vars) :polynomials (f) :value-type :polynomial)
525 (make-poly-from-termlist (list (make-term (poly-lm f) (funcall (ring-unit *maxima-ring*)))))))
526
527|#
Note: See TracBrowser for help on using the repository browser.