close Warning: Can't synchronize with repository "(default)" (The repository directory has changed, you should resynchronize the repository with: trac-admin $ENV repository resync '(default)'). Look in the Trac log for more information.

Changeset 4452 for branches/f4grobner


Ignore:
Timestamp:
2016-06-11T19:24:04-07:00 (9 years ago)
Author:
Marek Rychlik
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/f4grobner/polynomial.lisp

    r4451 r4452  
    443443
    444444(defmacro def-add/subtract-method (add/subtract-method-name
    445                                                 uminus-method-name
    446                                                 &optional
    447                                                 (doc-string nil doc-string-supplied-p))
     445                                   uminus-method-name
     446                                   &optional
     447                                     (doc-string nil doc-string-supplied-p))
    448448  "This macro avoids code duplication for two similar operations: ADD-TO and SUBTRACT-FROM."
    449449  `(defmethod ,add/subtract-method-name ((self poly) (other poly))
     
    490490  (add-termlists p q order-fn))
    491491
    492 (defmethod add-to ((self poly) (other poly) &aux (other-copy (copy-instance other)))
     492(defmethod add-to ((self poly) (other poly))
    493493  "Adds to polynomial SELF another polynomial OTHER.
    494494This operation destructively modifies both polynomials.
    495495The result is stored in SELF. This implementation does
    496496no consing, entirely reusing the sells of SELF and OTHER."
    497   (change-term-order other-copy self)
     497  (change-term-order other self)
    498498  (setf (poly-termlist self) (add-termlists
    499                               (poly-termlist self) (poly-termlist other-copy)
     499                              (poly-termlist self) (poly-termlist other)
    500500                              (poly-term-order self)))
    501501  self)
     
    514514
    515515
    516 (defmethod add-to ((self poly) (other term) &aux (other-copy (copy-instance other)))
     516(defmethod add-to ((self poly) (other term))
    517517  "Adds to a polynomial SELF a term OTHER. The term OTHER is not
    518518modified."
    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))
    522522  "Subtracts from a polynomial SELF a term OTHER. The term OTHER is not
    523523modified."
    524   (subtract-from self (change-class other-copy 'poly)))
     524  (subtract-from self (change-class other 'poly)))
    525525
    526526
Note: See TracChangeset for help on using the changeset viewer.