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 402 for branches/f4grobner


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

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/f4grobner/term.lisp

    r400 r402  
    2222(defpackage "TERM"
    2323  (:use :cl :monomial)
    24   (:export))
     24  (:export "MAKE-TERM-VARIABLE"
     25           "MAKE-TERM"
     26           "TERM-SUGAR"))
    2527
    2628
     
    5254  (monom-sugar (term-monom term)))
    5355
    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 terms
    62 ;;
    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 the
    73 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 powers
    80 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))
    8756
    8857(defun term-mul (ring term1 term2)
Note: See TracChangeset for help on using the changeset viewer.