- Timestamp:
- 2015-06-19T14:36:42-07:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/f4grobner/polynomial.lisp
r2529 r2530 106 106 self) 107 107 108 (defmethod add-to ((self poly) (other poly) &aux r) 109 (with-slots ((p termlist)) 108 (defmethod add-to ((self poly) (other poly)) 109 (macrolet ((lt (termlist) `(car ,termlist)) 110 (lc (termlist) `(term-coeff (lt ,termlist)))) 111 (with-slots ((p termlist) order) 110 112 self 111 113 (with-slots ((q termlist)) … … 120 122 (multiple-value-bind 121 123 (lm-greater lm-equal) 122 (funcall order ( termlist-lm p) (termlist-lmq))124 (funcall order (car p) (car q)) 123 125 (cond 124 126 (lm-equal 125 (let ((s ( funcall (ring-add ring) (termlist-lc p) (termlist-lc q))))126 (unless ( funcall (ring-zerop ring)s) ;check for cancellation127 (let ((s (r+ (lc p) (lc q)))) 128 (unless (r-zerop s) ;check for cancellation 127 129 (setf r (cons (make-term :monom (termlist-lm p) :coeff s) r))) 128 130 (setf p (cdr p) q (cdr q))))
Note:
See TracChangeset
for help on using the changeset viewer.