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 3295 for branches


Ignore:
Timestamp:
2015-06-23T08:59:45-07:00 (10 years ago)
Author:
Marek Rychlik
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/f4grobner/monom.lisp

    r3294 r3295  
    8282                                     &allow-other-keys
    8383                                       )
    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))
    8887      (setf (slot-value self 'dimension) dimension))
    8988
    90   (when (and exponents-supplied-p (slot-accessible-p 'exponents))
    91     (let ((dim (length exponents)))
    92       (when (and dimension-supplied-p (/= dimension dim))
    93         (error "EXPONENTS must have length DIMENSION"))
    94       (setf (slot-value self 'dimension) dim
    95             (slot-value self 'exponents) (make-array dim :initial-contents exponents))
    96       (setf (slot-value self 'dimension) (length exponents))))
    97 
    98   ;; when all exponents are to be identical
    99   (when (and exponent-supplied-p (slot-accessible-p 'exponents))
    100     (unless (slot-boundp self 'dimension)
    101     (error "Slot DIMENSION is unbound, but must be known if EXPONENT is supplied."))
    102     (let ((dim (slot-value self 'dimension)))
    103       (setf (slot-value self 'exponents)
    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))))))
    106105
    107106(defmethod r-equalp ((m1 monom) (m2 monom))
Note: See TracChangeset for help on using the changeset viewer.