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 2607 for branches/f4grobner


Ignore:
Timestamp:
2015-06-20T01:34:04-07:00 (9 years ago)
Author:
Marek Rychlik
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/f4grobner/polynomial.lisp

    r2605 r2607  
    9191  self)
    9292
    93 (defun fast-add-to (p q order-fn)
    94   "Fast destructive addition of termlists P and Q, ordered by
    95 predicate ORDER-FN. Note that this assumes the presence of a dummy
    96 header."
     93
     94(defun fast-addition (method-name p q order-fn add-fun)
    9795  (macrolet ((lt (x) `(cadr ,x))
    9896             (lc (x) `(r-coeff (cadr ,x))))
     
    108106           (rotatef (cdr p) (cdr q)))
    109107          (equal-p
    110            (let ((s (add-to (lc p) (lc q))))
     108           (let ((s (funcall add-fun (lc p) (lc q))))
    111109             (if (r-zerop s)
    112110                 (setf (cdr p) (cddr p))
     
    131129      (push nil termlist1)
    132130      (push nil termlist2)
    133       (fast-add-to termlist1 termlist2 order1)
     131      (fast-addition termlist1 termlist2 order1 #'add-to)
    134132      ;; Remove dummy head
    135133      (pop termlist1)))
Note: See TracChangeset for help on using the changeset viewer.