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 3879 for branches/f4grobner


Ignore:
Timestamp:
2016-05-28T21:23:10-07:00 (8 years ago)
Author:
Marek Rychlik
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/f4grobner/polynomial.lisp

    r3878 r3879  
    292292     self))
    293293
    294 (eval-when (:load-toplevel :execute)
    295 
    296   (def-add/subtract-method add-to nil
    297     "Adds to polynomial SELF another polynomial OTHER.
     294(defmethod add-to ((self poly) (other poly))
     295  "Adds to polynomial SELF another polynomial OTHER.
    298296This operation destructively modifies both polynomials.
    299297The result is stored in SELF. This implementation does
    300 no consing, entirely reusing the sells of SELF and OTHER.")
    301 
    302   (def-add/subtract-method subtract-from unary-minus
     298no consing, entirely reusing the sells of SELF and OTHER."
     299  (change-term-order other self)
     300  (setf (poly-termlist self) (add-termlists
     301                              (poly-termlist self) (poly-termlist other)
     302                              (poly-term-order self))))
     303 
     304
     305(defmethod subtract-from ((self poly) (other poly))
    303306    "Subtracts from polynomial SELF another polynomial OTHER.
    304307This operation destructively modifies both polynomials.
    305308The result is stored in SELF. This implementation does
    306 no consing, entirely reusing the sells of SELF and OTHER.")
    307   )
     309no consing, entirely reusing the sells of SELF and OTHER."
     310  (change-term-order other self)
     311  (setf (poly-termlist self) (subtract-termlists
     312                              (poly-termlist self) (poly-termlist other)
     313                              (poly-term-order self))))
    308314
    309315(defmethod unary-minus ((self poly))
Note: See TracChangeset for help on using the changeset viewer.