Changeset 4537 for branches/f4grobner
- Timestamp:
- 2016-06-18T13:46:17-07:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/f4grobner/slow-add.lisp
r4495 r4537 35 35 (t 36 36 (rotatef (cdr q) r q)))))) 37 38 (defun s-add (p q order-fn add-fn &aux result) 39 "Non-recursive version of SLOW-ADD." 40 (loop 41 (cond 42 ((endp p) (return-from s-add (nreconc result q))) 43 ((endp q) (return-from s-add (nreconc result p))) 44 (t 45 (multiple-value-bind 46 (greater-p equal-p) 47 (funcall order-fn (car p) (car q)) 48 (cond 49 (greater-p ; (> (car p) (car q)) 50 (push (pop p) result) 51 ) 52 (equal-p ; (= (car p)) (car q)) 53 (let ((s (funcall add-fn (lc p) (lc q)))) 54 (cond 55 ((universal-zerop s) 56 (pop p)) 57 (t 58 ;; Adjust the lc of p 59 (setf (lc p) s) 60 (push (pop p) result) 61 ) 62 )) 63 (pop q) 64 ) 65 (t ;(< (car p) (car q)) 66 (push (pop q) result) 67 ) 68 ))))))
Note:
See TracChangeset
for help on using the changeset viewer.