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 3315


Ignore:
Timestamp:
2015-06-23T09:57:00-07:00 (10 years ago)
Author:
Marek Rychlik
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/f4grobner/monom.lisp

    r3314 r3315  
    8181                                       &allow-other-keys
    8282                                       )
    83   (when dimension-supplied-p
    84     (when (and (slot-boundp self 'dimension)
    85                (/= (slot-value self 'dimension) dimension))
    86       (warn "Changing MONOM DIMENSION from ~A to ~A."
    87             (slot-value self 'dimension) dimension))
    88     (setf (slot-value self 'dimension) dimension))
    89 
    90   (when exponents-supplied-p
    91     (let ((dim (length exponents)))
    92       (when (and (slot-boundp self 'dimension)
    93                  (/= (slot-value self 'dimension) dim))
    94         (warn "Changing slot DIMENSION ~A to match the length of EXPONENTS ~A"
    95               (slot-value self 'dimension) (length exponents)))
    96       (setf (slot-value self 'dimension) dim
    97             (slot-value self 'exponents) (make-array dim :initial-contents exponents)
    98             (slot-value self 'dimension) (length exponents))))
    99 
    100   ;; when all exponents are to be identical
    101   (if exponent-supplied-p
    102     (when (slot-boundp self 'exponents)
    103       (warn "Ignoring argument EXPONENT, as slot EXPONENTS already bound."))
    104     (cond
    105       ((slot-boundp self 'dimension)
    106        (let ((dim (slot-value self 'dimension)))
    107          (setf (slot-value self 'exponents)
    108                (make-array (list dim) :initial-element (if exponent-supplied-p exponent 0)
    109                            :element-type 'exponent))))
     83  (cond
     84    (exponents-supplied-p
     85     (when exponent-supplied-p
     86       (warn "Ignoring initarg EXPONENT."))
     87     (when dimension-supplied-p
     88       (warn "Ignoring initarg DIMENSION."))
     89     (let ((dim (length exponents)))
     90       (setf (slot-value self 'exponents) (make-array dim :initial-contents exponents))))
     91    (exponent-supplied-p
     92     ;; when all exponents are to be identical
     93     (cond
     94       (dimension-supplied-p
     95        (setf (slot-value self 'exponents)
     96              (make-array (list dimension) :initial-element (if exponent-supplied-p exponent 0)
     97                          :element-type 'exponent))))
    11098      (t 
    111        (error "Slot DIMENSION is unbound, but must be known if EXPONENT is supplied.")))))
     99       (error "Initarg DIMENSION must be supplied if EXPONENT is supplied.")))))
    112100
    113101(defmethod r-equalp ((m1 monom) (m2 monom))
Note: See TracChangeset for help on using the changeset viewer.