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


Ignore:
Timestamp:
2015-06-17T18:10:22-07:00 (10 years ago)
Author:
Marek Rychlik
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/f4grobner/monom.lisp

    r2037 r2038  
    146146  (monom-total-degree m start end))
    147147
     148(defmethod ring-mul ((m1 monom) (m2 monom))  &aux (result (copy-seq m1)))
     149"Multiply monomial M1 by monomial M2."
     150  (with-slots ((exponents1 exponents))
     151      m1
     152    (with-slots ((exponents2 exponents))
     153        m2
     154      (let* ((exponents (copy-seq exponents1))
     155             (dim (reduce #'+ exponents)))
     156        (map-into exponents #'+ exponents1 exponents2)
     157        (make-instance 'monom :dim dim :exponents exponents)))))
     158
    148159(defmethod ring-div ((m1 monom) (m2 monom))
    149160  "Divide monomial M1 by monomial M2."
     
    157168        (make-instance 'monom :dim dim :exponents exponents)))))
    158169
    159 #|
    160 (defun monom-mul (m1 m2  &aux (result (copy-seq m1)))
    161   "Multiply monomial M1 by monomial M2."
    162   (declare (type monom m1 m2 result))
    163   (map-into result #'+ m1 m2))
     170
    164171
    165172(defun monom-divides-p (m1 m2)
Note: See TracChangeset for help on using the changeset viewer.