Changeset 2788 for branches/f4grobner/polynomial.lisp
- Timestamp:
- 2015-06-20T21:04:24-07:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/f4grobner/polynomial.lisp
r2787 r2788 192 192 193 193 194 (defun fast-multiply(p q)194 (defun multiply-termlists (p q) 195 195 (cond 196 196 ((or (endp p) (endp q)) nil) ;p or q is 0 (represented by NIL) 197 197 ;; If p=p0+p1 and q=q0+q1 then p*q=p0*q0+p0*q1+p1*q 198 198 ((endp (cdr p)) 199 ( term-times-termlist (car p) q))199 (multiply-term-by-termlist (car p) q) 200 200 ((endp (cdr q)) 201 ( termlist-times-term p (car q)))201 (multiply-termlist-by-term p (car q)) 202 202 (t 203 (let ((head ( term-mul-lst (termlist-lt p) (termlist-ltq)))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)))) 206 206 (cond ((null head) tail) 207 207 ((null tail) head) 208 (t (nconc head tail))))))) 208 (t (nconc head tail))))))))) 209 209 210 210 #|
Note:
See TracChangeset
for help on using the changeset viewer.