Changeset 4235
- Timestamp:
- 2016-06-04T19:01:11-07:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/f4grobner/monom.lisp
r4226 r4235 144 144 (length (monom-exponents self)))) 145 145 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)))) 150 149 151 150 (defgeneric monom-elt (m index) … … 657 656 (with-slots (coeff) 658 657 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))) 666 666 (t 667 (list '* coeff 667 (list '* coeff-sexp monom-sexp)))))))
Note:
See TracChangeset
for help on using the changeset viewer.