Changeset 402 for branches/f4grobner
- Timestamp:
- 2015-06-06T19:06:19-07:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/f4grobner/term.lisp
r400 r402 22 22 (defpackage "TERM" 23 23 (:use :cl :monomial) 24 (:export)) 24 (:export "MAKE-TERM-VARIABLE" 25 "MAKE-TERM" 26 "TERM-SUGAR")) 25 27 26 28 … … 52 54 (monom-sugar (term-monom term))) 53 55 54 (defun termlist-sugar (p &aux (sugar -1))55 (declare (fixnum sugar))56 (dolist (term p sugar)57 (setf sugar (max sugar (term-sugar term)))))58 59 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;60 ;;61 ;; Additional structure operations on a list of terms62 ;;63 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;64 65 (defun termlist-contract (p &optional (k 1))66 "Eliminate first K variables from a polynomial P."67 (mapcar #'(lambda (term) (make-term (monom-contract k (term-monom term))68 (term-coeff term)))69 p))70 71 (defun termlist-extend (p &optional (m (make-monom 1 :initial-element 0)))72 "Extend every monomial in a polynomial P by inserting at the73 beginning of every monomial the list of powers M."74 (mapcar #'(lambda (term) (make-term (monom-append m (term-monom term))75 (term-coeff term)))76 p))77 78 (defun termlist-add-variables (p n)79 "Add N variables to a polynomial P by inserting zero powers80 at the beginning of each monomial."81 (declare (fixnum n))82 (mapcar #'(lambda (term)83 (make-term (monom-append (make-monom n :initial-element 0)84 (term-monom term))85 (term-coeff term)))86 p))87 56 88 57 (defun term-mul (ring term1 term2)
Note:
See TracChangeset
for help on using the changeset viewer.