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 1890


Ignore:
Timestamp:
2015-06-15T17:47:06-07:00 (10 years ago)
Author:
Marek Rychlik
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/f4grobner/monom.lisp

    r1889 r1890  
    112112
    113113(defun monom-dimension (m)
     114  (declare (type monom m))
    114115  (length m))
    115116
     
    119120
    120121(defun monom-total-degree (m &optional (start 0) (end (monom-dimension m)))
     122  (declare (type monom m) (type fixnum start end))
    121123  "Return the todal degree of a monomoal M. Optinally, a range
    122124of variables may be specified with arguments START and END."
     
    124126
    125127(defun monom-sugar (m &aux (start 0) (end (monom-dimension m)))
     128  (declare (type monom m) (type fixnum start end))
    126129  "Return the sugar of a monomial M. Optinally, a range
    127130of variables may be specified with arguments START and END."
     
    129132
    130133(defun monom-div (m1 m2 &aux (result (copy-seq m1)))
     134  (declare (type monom m1 m2 result)
    131135  "Divide monomial M1 by monomial M2."
    132136  (map-into result #'- m1 m2))
     
    134138(defun monom-mul (m1 m2  &aux (result (copy-seq m1)))
    135139  "Multiply monomial M1 by monomial M2."
     140  (declare (type monom m1 m2 result)
    136141  (map-into result #'+ m1 m2))
    137142
    138143(defun monom-divides-p (m1 m2)
    139144  "Returns T if monomial M1 divides monomial M2, NIL otherwise."
     145  (declare (type monom m1 m2))
    140146  (every #'<= m1 m2))
    141147
    142148(defun monom-divides-monom-lcm-p (m1 m2 m3)
    143149  "Returns T if monomial M1 divides MONOM-LCM(M2,M3), NIL otherwise."
     150  (declare (type monom m1 m2 m3))
    144151  (every #'(lambda (x y z) (<= x (max y z)))
    145152         m1 m2 m3))
     
    147154(defun monom-lcm-divides-monom-lcm-p (m1 m2 m3 m4)
    148155  "Returns T if monomial MONOM-LCM(M1,M2) divides MONOM-LCM(M3,M4), NIL otherwise."
     156  (declare (type monom m1 m2 m3 m4))
    149157  (every #'(lambda (x y z w) (<= (max x y) (max z w)))
    150158         m1 m2 m3 m4))
     
    153161(defun monom-lcm-equal-monom-lcm-p (m1 m2 m3 m4)
    154162  "Returns T if monomial MONOM-LCM(M1,M2) equals MONOM-LCM(M3,M4), NIL otherwise."
     163  (declare (type monom m1 m2 m3 m4))
    155164  (every #'(lambda (x y z w) (= (max x y) (max z w)))
    156165         m1 m2 m3 m4))
     
    159168(defun monom-divisible-by-p (m1 m2)
    160169  "Returns T if monomial M1 is divisible by monomial M2, NIL otherwise."
     170  (declare (type monom m1 m2))
    161171  (every #'>= m1 m2))
    162172
    163173(defun monom-rel-prime-p (m1 m2)
    164174  "Returns T if two monomials M1 and M2 are relatively prime (disjoint)."
     175  (declare (type monom m1 m2))
    165176  (every #'(lambda (x y) (zerop (min x y))) m1 m2))
    166177
    167178(defun monom-equal-p (m1 m2)
    168179  "Returns T if two monomials M1 and M2 are equal."
     180  (declare (type monom m1 m2))
    169181  (every #'= m1 m2))
    170182
    171183(defun monom-lcm (m1 m2 &aux (result (copy-seq m1)))
    172184  "Returns least common multiple of monomials M1 and M2."
     185  (declare (type monom m1 m2 result))
    173186  (map-into result #'max m1 m2))
    174187
    175188(defun monom-gcd (m1 m2 &aux (result (copy-seq m1)))
    176189  "Returns greatest common divisor of monomials M1 and M2."
     190  (declare (type monom m1 m2 result))
    177191  (map-into result #'min m1 m2))
    178192
    179193(defun monom-depends-p (m k)
    180194  "Return T if the monomial M depends on variable number K."
     195  (declare (type monom m) (type fixnum k))
    181196  (plusp (monom-elt m k)))
    182197
Note: See TracChangeset for help on using the changeset viewer.