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 2593


Ignore:
Timestamp:
2015-06-20T00:42:55-07:00 (10 years ago)
Author:
Marek Rychlik
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/f4grobner/polynomial.lisp

    r2591 r2593  
    8686  self)
    8787
    88 (defun fast-add-to (p q)
     88(defun fast-add-to (p q order-fn)
    8989  "Fast destructive addition of termlists
    9090Note that this assumes the presence of a
     
    9898      (multiple-value-bind
    9999            (greater-p equal-p)
    100           (lex> (lt q) (lt p))
     100          (funcall order-fn (lt q) (lt p))
    101101        (cond
    102102          (greater-p
     
    115115The result is stored in SELF. This implementation does
    116116no consing, entirely reusing the sells of SELF and OTHER."
    117   (with-slots ((termlist1 termlist))
     117  (with-slots ((termlist1 termlist) (order1 order))
    118118      self
    119     (with-slots ((termlist2 termlist))
     119    (with-slots ((termlist2 termlist) (order2 order))
    120120        other
     121      (unless (eq order1 order2)
     122        (setf termlist2 (sort order1 termlist2)))
    121123      ;; Create dummy head
    122124      (push nil termlist1)
    123125      (push nil termlist2)
    124       (fast-add-to termlist1 termlist2)
     126      (fast-add-to termlist1 termlist2 order1)
    125127      ;; Remove dummy head
    126128      (pop termlist1)))
Note: See TracChangeset for help on using the changeset viewer.