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 2788 for branches


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

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/f4grobner/polynomial.lisp

    r2787 r2788  
    192192
    193193
    194 (defun fast-multiply (p q)
     194(defun multiply-termlists (p q)
    195195  (cond
    196196    ((or (endp p) (endp q)) nil)        ;p or q is 0 (represented by NIL)
    197197    ;; If p=p0+p1 and q=q0+q1 then p*q=p0*q0+p0*q1+p1*q
    198198    ((endp (cdr p))
    199      (term-times-termlist (car p) q))
     199     (multiply-term-by-termlist (car p) q)
    200200    ((endp (cdr q))
    201      (termlist-times-term p (car q)))
     201     (multiply-termlist-by-term p (car q))
    202202    (t
    203      (let ((head (term-mul-lst (termlist-lt p) (termlist-lt q)))
    204            (tail (termlist-add (term-times-termlist (car p) (cdr q))
    205                                (termlist-mul (cdr p) q))))
     203     (let ((head (multiply-terms (car p) (car q)))
     204           (tail (add-termlists (term-times-termlist (car p) (cdr q))
     205                                (multiply-termlists (cdr p) q))))
    206206       (cond ((null head) tail)
    207207             ((null tail) head)
    208              (t (nconc head tail)))))))
     208             (t (nconc head tail)))))))))
    209209
    210210#|
Note: See TracChangeset for help on using the changeset viewer.