Changeset 3295
- Timestamp:
- 2015-06-23T08:59:45-07:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/f4grobner/monom.lisp
r3294 r3295 82 82 &allow-other-keys 83 83 ) 84 (flet ((slot-accessible-p (slot-name)) 85 (or (eq slot-names t) (member 'dimension slot-names))) 86 87 (when (and dimension-supplied-p (slot-accessible-p 'dimension)) 84 (flet ((slot-accessible-p (slot-name)) 85 (or (eq slot-names t) (member 'dimension slot-names))) 86 (when (and dimension-supplied-p (slot-accessible-p 'dimension)) 88 87 (setf (slot-value self 'dimension) dimension)) 89 88 90 (when (and exponents-supplied-p (slot-accessible-p 'exponents))91 (let ((dim (length exponents)))92 93 (error "EXPONENTS must have length DIMENSION"))94 95 (slot-value self 'exponents) (make-array dim :initial-contents exponents))96 97 98 ;; when all exponents are to be identical99 (when (and exponent-supplied-p (slot-accessible-p 'exponents))100 (unless (slot-boundp self 'dimension)101 102 (let ((dim (slot-value self 'dimension)))103 104 (make-array (list dim) :initial-element (or exponent 0)105 :element-type 'exponent))))))89 (when (and exponents-supplied-p (slot-accessible-p 'exponents)) 90 (let ((dim (length exponents))) 91 (when (and dimension-supplied-p (/= dimension dim)) 92 (error "EXPONENTS must have length DIMENSION")) 93 (setf (slot-value self 'dimension) dim 94 (slot-value self 'exponents) (make-array dim :initial-contents exponents)) 95 (setf (slot-value self 'dimension) (length exponents)))) 96 97 ;; when all exponents are to be identical 98 (when (and exponent-supplied-p (slot-accessible-p 'exponents)) 99 (unless (slot-boundp self 'dimension) 100 (error "Slot DIMENSION is unbound, but must be known if EXPONENT is supplied.")) 101 (let ((dim (slot-value self 'dimension))) 102 (setf (slot-value self 'exponents) 103 (make-array (list dim) :initial-element (or exponent 0) 104 :element-type 'exponent)))))) 106 105 107 106 (defmethod r-equalp ((m1 monom) (m2 monom))
Note:
See TracChangeset
for help on using the changeset viewer.