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 2586


Ignore:
Timestamp:
2015-06-20T00:20:08-07:00 (9 years ago)
Author:
Marek Rychlik
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/f4grobner/polynomial.lisp

    r2585 r2586  
    113113The result is stored in SELF. This implementation does
    114114no consing, entirely reusing the sells of SELF and OTHER."
    115     (with-slots ((termlist1 termlist))
    116         self
    117       (with-slots ((termlist2 termlist))
    118           other
    119         (do ((p termlist1)
    120              (q termlist2))
    121             ((or (endp p) (endp q)))
    122           (multiple-value-bind
    123                 (greater-p equal-p)
    124               (lex> (lt q) (lt p))
    125             (cond
    126               (greater-p
    127                ;; P' <- Q
    128                ;; (CDR P') <- P
    129                ;; Q' <- (CDR Q)
    130                (rotatef p q (cdr q))
    131                (print p) (print q))
    132               (equal-p
    133                (setf (lc p) (+ (lc p) (lc q))
    134                      p (cdr p)
    135                      q (cdr q))
    136                (print p) (print q))
    137               (t
    138                (setf p (cdr p)))))))))
    139            
     115  (with-slots ((termlist1 termlist))
     116      self
     117    (with-slots ((termlist2 termlist))
     118        other
     119      (setf termlist1 (fast-add-to termlist1 termlist2))))
    140120  self)
    141121
Note: See TracChangeset for help on using the changeset viewer.