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


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

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/f4grobner/monom.lisp

    r2196 r2197  
    5959  ((dimension          :initarg :dimension :accessor monom-dimension)
    6060   (exponents :initarg :exponents :accessor monom-exponents))
    61   (:default-initargs :dim 0 :exponents nil))
     61  (:default-initargs :dimension 0 :exponents nil))
    6262
    6363(defmethod print-object ((m monom) stream)
     
    7171                     (initial-exponent  nil initial-exponent-supplied-p)
    7272                   &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"))))
    7676                     (exponents (cond
    7777                                  ;; when exponents are supplied
     
    7979                                   (when (and dimension-suppied-p (/= dimension (length initial-exponents)))
    8080                                     (error "INITIAL-EXPONENTS must have length DIMENSION"))
    81                                    (make-array (list dim) :initial-contents initial-exponents
     81                                   (make-array (list dimension) :initial-contents initial-exponents
    8282                                               :element-type 'exponent))
    8383                                  ;; when all exponents are to be identical
    8484                                  (initial-exponent-supplied-p
    85                                    (make-array (list dim) :initial-element initial-exponent
     85                                   (make-array (list dimension) :initial-element initial-exponent
    8686                                               :element-type 'exponent))
    8787                                  ;; otherwise, all exponents are zero
    8888                                  (t
    89                                    (make-array (list dim) :element-type 'exponent :initial-element 0)))))
     89                                   (make-array (list dimension) :element-type 'exponent :initial-element 0)))))
    9090  "A constructor (factory) of monomials. If DIMENSION is given, a sequence of
    9191DIMENSION elements of type EXPONENT is constructed, where individual
     
    9393Alternatively, all elements may be specified as a list
    9494INITIAL-EXPONENTS."
    95   (make-instance 'monom :dimension dim :exponents exponents))
     95  (make-instance 'monom :dimension dimension :exponents exponents))
    9696
    9797;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
     
    235235             (dimension (reduce #'+ exponents)))
    236236        (map-into exponents #'min exponents1 exponents2)
    237         (make-instance 'monom :dim dimension :exponents exponents)))))
     237        (make-instance 'monom :dimension dimension :exponents exponents)))))
    238238
    239239(defmethod r-depends-p ((m monom) k)
     
    260260  (with-slots (dimension exponents)
    261261      m
    262     (setf dimension (- dim k)
     262    (setf dimension (- dimension k)
    263263          exponents (subseq exponents k))))
    264264
Note: See TracChangeset for help on using the changeset viewer.