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 3634


Ignore:
Timestamp:
2015-09-05T20:32:23-07:00 (9 years ago)
Author:
Marek Rychlik
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/f4grobner/polynomial.lisp

    r3633 r3634  
    302302  self)
    303303
    304 (defmethod r+ ((poly1 poly) poly2)
     304(defun add (object1 object2)
    305305  "Non-destructively add POLY1 by POLY2."
    306   (poly-add-to (copy-instance POLY1) (change-class (copy-instance POLY2) 'poly)))
    307 
    308 (defmethod r- ((minuend poly) &rest subtrahends)
     306  (add-to (copy-instance object1) (copy-instance object2)))
     307
     308(defun subtract (minuend &rest subtrahends)
    309309  "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)))
    326311
    327312(defmethod left-tensor-product-by ((self poly) (other monom))
Note: See TracChangeset for help on using the changeset viewer.