close Warning: Can't synchronize with repository "(default)" (The repository directory has changed, you should resynchronize the repository with: trac-admin $ENV repository resync '(default)'). Look in the Trac log for more information.

Changeset 3298 for branches/f4grobner


Ignore:
Timestamp:
2015-06-23T09:11:31-07:00 (9 years ago)
Author:
Marek Rychlik
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/f4grobner/monom.lisp

    r3297 r3298  
    8282                                       &allow-other-keys
    8383                                       )
    84     (when (and dimension-supplied-p (slot-accessible-p 'dimension))
    85       (setf (slot-value self 'dimension) dimension))
    86 
    87     (when (and exponents-supplied-p (slot-accessible-p 'exponents))
    88       (let ((dim (length exponents)))
    89         (when (and dimension-supplied-p (/= dimension dim))
    90           (error "EXPONENTS must have length DIMENSION"))
    91         (setf (slot-value self 'dimension) dim
    92               (slot-value self 'exponents) (make-array dim :initial-contents exponents))
    93         (setf (slot-value self 'dimension) (length exponents))))
    94 
    95     ;; when all exponents are to be identical
    96     (when (and exponent-supplied-p (slot-accessible-p 'exponents))
    97       (unless (slot-boundp self 'dimension)
    98         (error "Slot DIMENSION is unbound, but must be known if EXPONENT is supplied."))
    99       (let ((dim (slot-value self 'dimension)))
    100         (setf (slot-value self 'exponents)
    101               (make-array (list dim) :initial-element exponent
    102                           :element-type 'exponent))))))
     84  (when dimension-supplied-p
     85    (setf (slot-value self 'dimension) dimension))
     86
     87  (when exponents-supplied-p
     88    (let ((dim (length exponents)))
     89      (when (and dimension-supplied-p (/= dimension dim))
     90        (error "EXPONENTS must have length DIMENSION"))
     91      (setf (slot-value self 'dimension) dim
     92            (slot-value self 'exponents) (make-array dim :initial-contents exponents))
     93      (setf (slot-value self 'dimension) (length exponents))))
     94
     95  ;; when all exponents are to be identical
     96  (when (and exponent-supplied-p (slot-accessible-p 'exponents))
     97    (unless (slot-boundp self 'dimension)
     98      (error "Slot DIMENSION is unbound, but must be known if EXPONENT is supplied."))
     99    (let ((dim (slot-value self 'dimension)))
     100      (setf (slot-value self 'exponents)
     101            (make-array (list dim) :initial-element exponent
     102                        :element-type 'exponent)))))
    103103
    104104(defmethod r-equalp ((m1 monom) (m2 monom))
Note: See TracChangeset for help on using the changeset viewer.