- Timestamp:
- 2015-06-20T00:20:08-07:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/f4grobner/polynomial.lisp
r2585 r2586 113 113 The result is stored in SELF. This implementation does 114 114 no consing, entirely reusing the sells of SELF and OTHER." 115 (with-slots ((termlist1 termlist)) 116 self 117 (with-slots ((termlist2 termlist)) 118 other 119 (do ((p termlist1) 120 (q termlist2)) 121 ((or (endp p) (endp q))) 122 (multiple-value-bind 123 (greater-p equal-p) 124 (lex> (lt q) (lt p)) 125 (cond 126 (greater-p 127 ;; P' <- Q 128 ;; (CDR P') <- P 129 ;; Q' <- (CDR Q) 130 (rotatef p q (cdr q)) 131 (print p) (print q)) 132 (equal-p 133 (setf (lc p) (+ (lc p) (lc q)) 134 p (cdr p) 135 q (cdr q)) 136 (print p) (print q)) 137 (t 138 (setf p (cdr p))))))))) 139 115 (with-slots ((termlist1 termlist)) 116 self 117 (with-slots ((termlist2 termlist)) 118 other 119 (setf termlist1 (fast-add-to termlist1 termlist2)))) 140 120 self) 141 121
Note:
See TracChangeset
for help on using the changeset viewer.