Changeset 4452 for branches/f4grobner
- Timestamp:
- 2016-06-11T19:24:04-07:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/f4grobner/polynomial.lisp
r4451 r4452 443 443 444 444 (defmacro def-add/subtract-method (add/subtract-method-name 445 446 447 445 uminus-method-name 446 &optional 447 (doc-string nil doc-string-supplied-p)) 448 448 "This macro avoids code duplication for two similar operations: ADD-TO and SUBTRACT-FROM." 449 449 `(defmethod ,add/subtract-method-name ((self poly) (other poly)) … … 490 490 (add-termlists p q order-fn)) 491 491 492 (defmethod add-to ((self poly) (other poly) &aux (other-copy (copy-instance other)))492 (defmethod add-to ((self poly) (other poly)) 493 493 "Adds to polynomial SELF another polynomial OTHER. 494 494 This operation destructively modifies both polynomials. 495 495 The result is stored in SELF. This implementation does 496 496 no consing, entirely reusing the sells of SELF and OTHER." 497 (change-term-order other -copyself)497 (change-term-order other self) 498 498 (setf (poly-termlist self) (add-termlists 499 (poly-termlist self) (poly-termlist other -copy)499 (poly-termlist self) (poly-termlist other) 500 500 (poly-term-order self))) 501 501 self) … … 514 514 515 515 516 (defmethod add-to ((self poly) (other term) &aux (other-copy (copy-instance other)))516 (defmethod add-to ((self poly) (other term)) 517 517 "Adds to a polynomial SELF a term OTHER. The term OTHER is not 518 518 modified." 519 (add-to self (change-class other -copy'poly)))520 521 (defmethod subtract-from ((self poly) (other term) &aux (other-copy (copy-instance other)))519 (add-to self (change-class other 'poly))) 520 521 (defmethod subtract-from ((self poly) (other term)) 522 522 "Subtracts from a polynomial SELF a term OTHER. The term OTHER is not 523 523 modified." 524 (subtract-from self (change-class other -copy'poly)))524 (subtract-from self (change-class other 'poly))) 525 525 526 526
Note:
See TracChangeset
for help on using the changeset viewer.