- Timestamp:
- 2015-06-08T22:14:12-07:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/f4grobner/term.lisp
r773 r774 60 60 &optional 61 61 (power 1) 62 (coeff (funcall (ring-unit ring))) 63 &aux 64 (monom (make-monom nvars :initial-exponent 0))) 62 (coeff (funcall (ring-unit ring)))) 65 63 "Construct a term in the polynomial ring RING[X[0],X[1],X[2],...X[NVARS-1]] 66 64 over the ring RING which represents a single variable. It assumes … … 70 68 defaults to the unit of the RING." 71 69 (declare (fixnum nvars pos power)) 72 (incf (monom-elt monom pos) power) 73 (make-term monom coeff)) 70 (let ((result (make-term nvars))) 71 (setf (monom-elt result pos) power) 72 result)) 74 73 75 74 (defun term-mul (ring term1 term2) … … 79 78 (let ((c (funcall (ring-mul ring) (term-coeff term1) (term-coeff term2)))) 80 79 (unless (funcall (ring-zerop ring) c) 81 (make-term (monom-mul term1 term2) c)))) 80 (make-term (+ (monom-dimension term1) (monom-dimension term2)) 81 :initial-exponents (monom-exponents (monom-mul term1 term2)) 82 :coeff c)))) 82 83 83 84 (defun term-sugar (term)
Note:
See TracChangeset
for help on using the changeset viewer.