Changeset 2779
- Timestamp:
- 2015-06-20T20:22:42-07:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/f4grobner/monom.lisp
r2778 r2779 51 51 52 52 (defclass monom () 53 ((dimension :initarg :dimension :accessor r-dimension) 54 (exponents :initarg :exponents :accessor r-exponents)) 55 (:default-initargs :dimension nil :exponents nil :exponent nil)) 53 ((dimension :initarg :dimension :accessor monom-dimension) 54 (exponents :initarg :exponents :accessor monom-exponents)) 55 (:default-initargs :dimension nil :exponents nil :exponent nil) 56 (:documentation 57 "Implements a monomial, i.e. a product of powers 58 of variables, like X*Y^2.")) 56 59 57 60 (defmethod print-object ((self monom) stream) 58 61 (format stream "#<MONOM DIMENSION=~A EXPONENTS=~A>" 59 ( r-dimension self)60 ( r-exponents self)))62 (monom-dimension self) 63 (monom-exponents self))) 61 64 62 65 (defmethod shared-initialize :after ((self monom) slot-names … … 97 100 EXPONENTS." 98 101 (declare (type monom m1 m2)) 99 (equalp ( r-exponents m1) (r-exponents m2)))102 (equalp (monom-exponents m1) (monom-exponents m2))) 100 103 101 104 (defmethod r-coeff ((m monom)) … … 116 119 (setf (elt exponents index) new-value))) 117 120 118 (defmethod r-total-degree ((m monom) &optional (start 0) (end ( r-dimension m)))121 (defmethod r-total-degree ((m monom) &optional (start 0) (end (monom-dimension m))) 119 122 "Return the todal degree of a monomoal M. Optinally, a range 120 123 of variables may be specified with arguments START and END." … … 125 128 126 129 127 (defmethod r-sugar ((m monom) &aux (start 0) (end ( r-dimension m)))130 (defmethod r-sugar ((m monom) &aux (start 0) (end (monom-dimension m))) 128 131 "Return the sugar of a monomial M. Optinally, a range 129 132 of variables may be specified with arguments START and END." … … 278 281 (defmethod r->list ((m monom)) 279 282 "A human-readable representation of a monomial M as a list of exponents." 280 (coerce ( r-exponents m) 'list))283 (coerce (monom-exponents m) 'list))
Note:
See TracChangeset
for help on using the changeset viewer.