Changeset 1890
- Timestamp:
- 2015-06-15T17:47:06-07:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/f4grobner/monom.lisp
r1889 r1890 112 112 113 113 (defun monom-dimension (m) 114 (declare (type monom m)) 114 115 (length m)) 115 116 … … 119 120 120 121 (defun monom-total-degree (m &optional (start 0) (end (monom-dimension m))) 122 (declare (type monom m) (type fixnum start end)) 121 123 "Return the todal degree of a monomoal M. Optinally, a range 122 124 of variables may be specified with arguments START and END." … … 124 126 125 127 (defun monom-sugar (m &aux (start 0) (end (monom-dimension m))) 128 (declare (type monom m) (type fixnum start end)) 126 129 "Return the sugar of a monomial M. Optinally, a range 127 130 of variables may be specified with arguments START and END." … … 129 132 130 133 (defun monom-div (m1 m2 &aux (result (copy-seq m1))) 134 (declare (type monom m1 m2 result) 131 135 "Divide monomial M1 by monomial M2." 132 136 (map-into result #'- m1 m2)) … … 134 138 (defun monom-mul (m1 m2 &aux (result (copy-seq m1))) 135 139 "Multiply monomial M1 by monomial M2." 140 (declare (type monom m1 m2 result) 136 141 (map-into result #'+ m1 m2)) 137 142 138 143 (defun monom-divides-p (m1 m2) 139 144 "Returns T if monomial M1 divides monomial M2, NIL otherwise." 145 (declare (type monom m1 m2)) 140 146 (every #'<= m1 m2)) 141 147 142 148 (defun monom-divides-monom-lcm-p (m1 m2 m3) 143 149 "Returns T if monomial M1 divides MONOM-LCM(M2,M3), NIL otherwise." 150 (declare (type monom m1 m2 m3)) 144 151 (every #'(lambda (x y z) (<= x (max y z))) 145 152 m1 m2 m3)) … … 147 154 (defun monom-lcm-divides-monom-lcm-p (m1 m2 m3 m4) 148 155 "Returns T if monomial MONOM-LCM(M1,M2) divides MONOM-LCM(M3,M4), NIL otherwise." 156 (declare (type monom m1 m2 m3 m4)) 149 157 (every #'(lambda (x y z w) (<= (max x y) (max z w))) 150 158 m1 m2 m3 m4)) … … 153 161 (defun monom-lcm-equal-monom-lcm-p (m1 m2 m3 m4) 154 162 "Returns T if monomial MONOM-LCM(M1,M2) equals MONOM-LCM(M3,M4), NIL otherwise." 163 (declare (type monom m1 m2 m3 m4)) 155 164 (every #'(lambda (x y z w) (= (max x y) (max z w))) 156 165 m1 m2 m3 m4)) … … 159 168 (defun monom-divisible-by-p (m1 m2) 160 169 "Returns T if monomial M1 is divisible by monomial M2, NIL otherwise." 170 (declare (type monom m1 m2)) 161 171 (every #'>= m1 m2)) 162 172 163 173 (defun monom-rel-prime-p (m1 m2) 164 174 "Returns T if two monomials M1 and M2 are relatively prime (disjoint)." 175 (declare (type monom m1 m2)) 165 176 (every #'(lambda (x y) (zerop (min x y))) m1 m2)) 166 177 167 178 (defun monom-equal-p (m1 m2) 168 179 "Returns T if two monomials M1 and M2 are equal." 180 (declare (type monom m1 m2)) 169 181 (every #'= m1 m2)) 170 182 171 183 (defun monom-lcm (m1 m2 &aux (result (copy-seq m1))) 172 184 "Returns least common multiple of monomials M1 and M2." 185 (declare (type monom m1 m2 result)) 173 186 (map-into result #'max m1 m2)) 174 187 175 188 (defun monom-gcd (m1 m2 &aux (result (copy-seq m1))) 176 189 "Returns greatest common divisor of monomials M1 and M2." 190 (declare (type monom m1 m2 result)) 177 191 (map-into result #'min m1 m2)) 178 192 179 193 (defun monom-depends-p (m k) 180 194 "Return T if the monomial M depends on variable number K." 195 (declare (type monom m) (type fixnum k)) 181 196 (plusp (monom-elt m k))) 182 197
Note:
See TracChangeset
for help on using the changeset viewer.