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.

Changeset 401 for branches


Ignore:
Timestamp:
2015-06-06T19:06:08-07:00 (10 years ago)
Author:
Marek Rychlik
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/f4grobner/termlist.lisp

    r380 r401  
    2121
    2222(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
     37beginning 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
     44at 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
    2352
    2453;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Note: See TracChangeset for help on using the changeset viewer.