- Timestamp:
- 2016-05-28T01:11:58-07:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/f4grobner/monom.lisp
r3812 r3823 236 236 (defun divide (numerator &rest denominators) 237 237 "Non-destructively divide object NUMERATOR by product of DENOMINATORS." 238 (divide-by (copy-instance numerator) (apply #'multiply denominators))) 238 (cond ((endp denominators) 239 (divide-by 1 numerator)) 240 (t (divide-by (copy-instance numerator) (apply #'multiply denominators))))) 239 241 240 242 (defgeneric divides-p (object1 object2) … … 392 394 (defun make-monom-constant (dimension) 393 395 (make-instance 'monom :dimension dimension)) 394 395 (defgeneric ->list (object)396 (:method ((m monom))397 "A human-readable representation of a monomial M as a list of exponents."398 (coerce (monom-exponents m) 'list)))399 396 400 397 ;; pure lexicographic … … 596 593 (:method ((self term)) 597 594 (universal-zerop (term-coeff self)))) 595 596 (defgeneric ->list (self) 597 (:method ((self monom)) 598 "A human-readable representation of a monomial SELF as a list of exponents." 599 (coerce (monom-exponents self) 'list)) 600 (:method ((self term)) 601 "A human-readable representation of a term SELF as a cons of the list of exponents and the coefficient." 602 (cons (coerce (monom-exponents m) 'list) (term-coeff m))))
Note:
See TracChangeset
for help on using the changeset viewer.