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 4235


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

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/f4grobner/monom.lisp

    r4226 r4235  
    144144    (length (monom-exponents self))))
    145145
    146 (defgeneric universal-equalp (object1 object2)
    147   (:method ((m1 monom) (m2 monom))
    148     "Returns T iff monomials M1 and M2 have identical EXPONENTS."
    149     (equalp (monom-exponents m1) (monom-exponents m2))))
     146(defmethod universal-equalp ((self monom) (other monom))
     147    "Returns T iff monomials SELF and OTHER have identical EXPONENTS."
     148  (equalp (monom-exponents self) (monom-exponents other))))
    150149
    151150(defgeneric monom-elt (m index)
     
    657656    (with-slots (coeff)
    658657        object
    659       (let ((sexp (call-next-method)))
    660         (cond ((eql coeff 1) sexp)
    661               ((atom sexp)
    662                (cond ((eql sexp 1) coeff)
    663                      (t (list '* coeff sexp))))
    664               ((eql (car sexp) '*)
    665                (list* '* coeff (cdr sexp)))
     658      (let ((monom-sexp (call-next-method))
     659            (coeff-sexp (->sexp coeff)))
     660        (cond ((eql coeff-sexp 1) monom-sexp)
     661              ((atom monom-sexp)
     662               (cond ((eql monom-sexp 1) coeff-sexp)
     663                     (t (list '* coeff-sexp monom-sexp))))
     664              ((eql (car monom-sexp) '*)
     665               (list* '* coeff-sexp (cdr monom-sexp)))
    666666              (t
    667                (list '* coeff sexp)))))))
     667               (list '* coeff-sexp monom-sexp)))))))
Note: See TracChangeset for help on using the changeset viewer.