Changeset 3634
- Timestamp:
- 2015-09-05T20:32:23-07:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/f4grobner/polynomial.lisp
r3633 r3634 302 302 self) 303 303 304 (def method r+ ((poly1 poly) poly2)304 (defun add (object1 object2) 305 305 "Non-destructively add POLY1 by POLY2." 306 ( poly-add-to (copy-instance POLY1) (change-class (copy-instance POLY2) 'poly)))307 308 (def method r- ((minuend poly)&rest subtrahends)306 (add-to (copy-instance object1) (copy-instance object2))) 307 308 (defun subtract (minuend &rest subtrahends) 309 309 "Non-destructively subtract MINUEND and SUBTRAHENDS." 310 (poly-subtract-from (copy-instance minuend) 311 (change-class (reduce #'r+ subtrahends) 'poly))) 312 313 (defmethod r+ ((poly1 monom) poly2) 314 "Non-destructively add POLY1 by POLY2." 315 (poly-add-to (change-class (copy-instance poly1) 'poly) 316 (change-class (copy-instance poly2) 'poly))) 317 318 (defmethod r- ((minuend monom) &rest subtrahends) 319 "Non-destructively subtract MINUEND and SUBTRAHENDS." 320 (poly-subtract-from (change-class (copy-instance minuend) 'poly) 321 (change-class (reduce #'r+ subtrahends) 'poly))) 322 323 (defmethod r* ((poly1 poly) (poly2 poly)) 324 "Non-destructively multiply POLY1 by POLY2." 325 (multiply-by (copy-instance poly1) (copy-instance poly2))) 310 (subtract-from (copy-instance minuend) (reduce #'add subtrahends))) 326 311 327 312 (defmethod left-tensor-product-by ((self poly) (other monom))
Note:
See TracChangeset
for help on using the changeset viewer.