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


Ignore:
Timestamp:
2015-09-05T11:13:53-07:00 (9 years ago)
Author:
Marek Rychlik
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/f4grobner/polynomial.lisp

    r3505 r3506  
    155155
    156156(defmethod multiply-by ((self poly) (other monom))
    157   (mapc #'(lambda (term) (multiply-by term other))
    158         (poly-termlist self))
    159   self)
    160 
    161 (defmethod multiply-by ((self poly) (other term))
    162157  (mapc #'(lambda (term) (multiply-by term other))
    163158        (poly-termlist self))
     
    314309                 (change-class (reduce #'r+ subtrahends) 'poly)))
    315310
    316 (defmethod r+ ((poly1 term) poly2)
    317   "Non-destructively add POLY1 by POLY2."
    318   (add-to (change-class (copy-instance poly1) 'poly)
    319           (change-class (copy-instance poly2) 'poly)))
    320 
    321 (defmethod r- ((minuend term) &rest subtrahends)
    322   "Non-destructively subtract MINUEND and SUBTRAHENDS."
    323   (subtract-from (change-class (copy-instance minuend) 'poly)
    324                  (change-class (reduce #'r+ subtrahends) 'poly)))
    325 
    326311(defmethod r+ ((poly1 monom) poly2)
    327312  "Non-destructively add POLY1 by POLY2."
     
    337322  "Non-destructively multiply POLY1 by POLY2."
    338323  (multiply-by (copy-instance poly1) (copy-instance poly2)))
    339 
    340 (defmethod left-tensor-product-by ((self poly) (other term))
    341   (setf (poly-termlist self)
    342         (mapcan #'(lambda (term)
    343                     (let ((prod (left-tensor-product-by term other)))
    344                       (cond
    345                         ((r-zerop prod) nil)
    346                         (t (list prod)))))
    347                 (poly-termlist self)))
    348   self)
    349 
    350 (defmethod right-tensor-product-by ((self poly) (other term))
    351   (setf (poly-termlist self)
    352         (mapcan #'(lambda (term)
    353                     (let ((prod (right-tensor-product-by term other)))
    354                       (cond
    355                         ((r-zerop prod) nil)
    356                         (t (list prod)))))
    357                 (poly-termlist self)))
    358   self)
    359324
    360325(defmethod left-tensor-product-by ((self poly) (other monom))
Note: See TracChangeset for help on using the changeset viewer.