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 3255


Ignore:
Timestamp:
2015-06-22T20:42:51-07:00 (10 years ago)
Author:
Marek Rychlik
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/f4grobner/polynomial.lisp

    r3254 r3255  
    136136
    137137(defmethod multiply-by ((self poly) (other monom))
    138   (assert (= (monom-dimension self) (poly-dimension other)))
     138  (cond ((null (poly-dimension self))
     139         (setf (poly-dimension self) (monom-dimension other)))
     140        (t (assert (= (monom-dimension item) (poly-dimension self)))))
    139141  (mapc #'(lambda (term) (multiply-by term other))
    140142        (poly-termlist self))
     
    142144
    143145(defmethod multiply-by ((self poly) (other term))
    144   (assert (= (monom-dimension self) (monom-dimension other)))
     146  (cond ((null (poly-dimension self))
     147         (setf (poly-dimension self) (monom-dimension other)))
     148        (t (assert (= (monom-dimension item) (poly-dimension self)))))
    145149  (mapc #'(lambda (term) (multiply-by term other))
    146150        (poly-termlist self))
     
    148152
    149153(defmethod multiply-by ((self poly) (other scalar))
    150   (assert (= (monom-dimension self) (monom-dimension other)))
    151154  (mapc #'(lambda (term) (multiply-by term other))
    152155        (poly-termlist self))
Note: See TracChangeset for help on using the changeset viewer.