Changeset 2197 for branches/f4grobner
- Timestamp:
- 2015-06-18T09:10:07-07:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/f4grobner/monom.lisp
r2196 r2197 59 59 ((dimension :initarg :dimension :accessor monom-dimension) 60 60 (exponents :initarg :exponents :accessor monom-exponents)) 61 (:default-initargs :dim 0 :exponents nil))61 (:default-initargs :dimension 0 :exponents nil)) 62 62 63 63 (defmethod print-object ((m monom) stream) … … 71 71 (initial-exponent nil initial-exponent-supplied-p) 72 72 &aux 73 (dim (cond (dimension-suppied-p dimension)74 (initial-exponents-supplied-p (length initial-exponents))75 (t (error "You must provide DIMENSION or INITIAL-EXPONENTS"))))73 (dimension (cond (dimension-suppied-p dimension) 74 (initial-exponents-supplied-p (length initial-exponents)) 75 (t (error "You must provide DIMENSION or INITIAL-EXPONENTS")))) 76 76 (exponents (cond 77 77 ;; when exponents are supplied … … 79 79 (when (and dimension-suppied-p (/= dimension (length initial-exponents))) 80 80 (error "INITIAL-EXPONENTS must have length DIMENSION")) 81 (make-array (list dim ) :initial-contents initial-exponents81 (make-array (list dimension) :initial-contents initial-exponents 82 82 :element-type 'exponent)) 83 83 ;; when all exponents are to be identical 84 84 (initial-exponent-supplied-p 85 (make-array (list dim ) :initial-element initial-exponent85 (make-array (list dimension) :initial-element initial-exponent 86 86 :element-type 'exponent)) 87 87 ;; otherwise, all exponents are zero 88 88 (t 89 (make-array (list dim ) :element-type 'exponent :initial-element 0)))))89 (make-array (list dimension) :element-type 'exponent :initial-element 0))))) 90 90 "A constructor (factory) of monomials. If DIMENSION is given, a sequence of 91 91 DIMENSION elements of type EXPONENT is constructed, where individual … … 93 93 Alternatively, all elements may be specified as a list 94 94 INITIAL-EXPONENTS." 95 (make-instance 'monom :dimension dim :exponents exponents))95 (make-instance 'monom :dimension dimension :exponents exponents)) 96 96 97 97 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; … … 235 235 (dimension (reduce #'+ exponents))) 236 236 (map-into exponents #'min exponents1 exponents2) 237 (make-instance 'monom :dim dimension :exponents exponents)))))237 (make-instance 'monom :dimension dimension :exponents exponents))))) 238 238 239 239 (defmethod r-depends-p ((m monom) k) … … 260 260 (with-slots (dimension exponents) 261 261 m 262 (setf dimension (- dim k)262 (setf dimension (- dimension k) 263 263 exponents (subseq exponents k)))) 264 264
Note:
See TracChangeset
for help on using the changeset viewer.