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


Ignore:
Timestamp:
2015-06-08T20:38:08-07:00 (10 years ago)
Author:
Marek Rychlik
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/f4grobner/monomial.lisp

    r728 r729  
    110110  (monom-total-degree (monom-exponents m) start end))
    111111
    112 (defun monom-div (m1 m2 &aux (result (copy-seq (monom-exponents m1))))
     112(defun monom-div (m1 m2 &aux (result (copy-structure m1)))
    113113  "Divide monomial M1 by monomial M2."
    114114  (declare (type monom m1 m2))
    115   (map-into result #'- m1 m2)
    116   (make-monom (monom-dimension result)))
     115  (map-into (monom-exponents result) #'- (monom-exponents m1) (monom-exponents m2))
     116  result)
    117117
    118 (defun monom-mul (m1 m2  &aux (result (copy-seq m1)))
     118(defun monom-mul (m1 m2  &aux (result (copy-structure m1)))
    119119  "Multiply monomial M1 by monomial M2."
    120120  (declare (type monom m1 m2 result))
    121   (map-into result #'+ m1 m2))
     121  (map-into (monom-exponents result) #'+ (monom-exponents m1) (monom-exponents m2))
     122  result)
    122123
    123124(defun monom-divides-p (m1 m2)
Note: See TracChangeset for help on using the changeset viewer.