Changeset 401
- Timestamp:
- 2015-06-06T19:06:08-07:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/f4grobner/termlist.lisp
r380 r401 21 21 22 22 (in-package :ngrobner) 23 24 (defun termlist-sugar (p &aux (sugar -1)) 25 (declare (fixnum sugar)) 26 (dolist (term p sugar) 27 (setf sugar (max sugar (term-sugar term))))) 28 29 (defun termlist-contract (p &optional (k 1)) 30 "Eliminate first K variables from a polynomial P." 31 (mapcar #'(lambda (term) (make-term (monom-contract k (term-monom term)) 32 (term-coeff term))) 33 p)) 34 35 (defun termlist-extend (p &optional (m (make-monom 1 :initial-element 0))) 36 "Extend every monomial in a polynomial P by inserting at the 37 beginning of every monomial the list of powers M." 38 (mapcar #'(lambda (term) (make-term (monom-append m (term-monom term)) 39 (term-coeff term))) 40 p)) 41 42 (defun termlist-add-variables (p n) 43 "Add N variables to a polynomial P by inserting zero powers 44 at the beginning of each monomial." 45 (declare (fixnum n)) 46 (mapcar #'(lambda (term) 47 (make-term (monom-append (make-monom n :initial-element 0) 48 (term-monom term)) 49 (term-coeff term))) 50 p)) 51 23 52 24 53 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Note:
See TracChangeset
for help on using the changeset viewer.