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 2530


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

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/f4grobner/polynomial.lisp

    r2529 r2530  
    106106  self)
    107107
    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)
    110112      self
    111113    (with-slots ((q termlist))
     
    120122              (multiple-value-bind
    121123                    (lm-greater lm-equal)
    122                   (funcall order (termlist-lm p) (termlist-lm q))
     124                  (funcall order (car p) (car q))
    123125                (cond
    124126                  (lm-equal
    125                    (let ((s (funcall (ring-add ring) (termlist-lc p) (termlist-lc q))))
    126                      (unless (funcall (ring-zerop ring) s) ;check for cancellation
     127                   (let ((s (r+ (lc p) (lc q))))
     128                     (unless (r-zerop s) ;check for cancellation
    127129                       (setf r (cons (make-term :monom (termlist-lm p) :coeff s) r)))
    128130                     (setf p (cdr p) q (cdr q))))
Note: See TracChangeset for help on using the changeset viewer.