Changeset 3442
- Timestamp:
- 2015-09-05T09:07:05-07:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/f4grobner/monom.lisp
r3441 r3442 21 21 22 22 (defpackage "MONOM" 23 (:use :cl :ring)23 (:use :cl) 24 24 (:export "MONOM" 25 25 "EXPONENT" 26 26 "MONOM-DIMENSION" 27 27 "MONOM-EXPONENTS" 28 "MAKE-MONOM-VARIABLE") 28 "MONOM-EQUALP" 29 "MONOM-ELT" 30 "MONOM-TOTAL-DEGREE" 31 "MONOM-SUGRAR" 32 "MONOM-MULTIPLY-BY" 33 "MONOM-DIVIDE-BY" 34 "MONOM-COPY-INSTANCE" 35 "MONOM-MULTIPLY-2" 36 "MONOM-MULTIPLY" 37 "MONOM-DIVIDES-P" 38 "MONOM-DIVIDES-LCM-P" 39 "MONOM-LCM-DIVIDES-LCM-P" 40 "MONOM-LCM-EQUAL-LCM-P" 41 "MONOM-DIVISIBLE-BY-P" 42 "MONOM-REL-PRIME-P" 43 "MONOM-LCM" 44 "MONOM-GCD" 45 "MONOM-DEPENDS-P" 46 "MONOM-LEFT-TENSOR-PRODUCT-BY" 47 "MONOM-RIGHT-TENSOR-PRODUCT-BY" 48 "MONOM-LEFT-CONTRACT" 49 "MAKE-MONOM-VARIABLE" 50 "MONOM->LIST") 51 29 52 (:documentation 30 53 "This package implements basic operations on monomials. … … 137 160 (monom-total-degree m start end)) 138 161 139 (defmethod m ultiply-by ((self monom) (other monom))162 (defmethod monom-multiply-by ((self monom) (other monom)) 140 163 (with-slots ((exponents1 exponents)) 141 164 self … … 159 182 self) 160 183 161 (defmethod copy-instance :around((object monom) &rest initargs &key &allow-other-keys)184 (defmethod monom-copy-instance ((object monom) &rest initargs &key &allow-other-keys) 162 185 "An :AROUNT method for COPY-INSTANCE. The primary method is a shallow copy, 163 186 while for monomials we typically need a fresh copy of the … … 168 191 copy)) 169 192 170 (defmethod monom *((m1 monom) (m2 monom))193 (defmethod monom-multiply-2 ((m1 monom) (m2 monom)) 171 194 "Non-destructively multiply monomial M1 by M2." 172 195 (multiply-by (copy-instance m1) (copy-instance m2))) 173 196 174 (defmethod monom *((numerator monom) &rest denominators)197 (defmethod monom-multiply ((numerator monom) &rest denominators) 175 198 "Non-destructively divide monomial NUMERATOR by product of DENOMINATORS." 176 (divide-by (copy-instance numerator) (reduce #' 177 monom* denominators))) 199 (divide-by (copy-instance numerator) (reduce #'monom-multiply-2 denominators))) 178 200 179 201 (defmethod monom-divides-p ((m1 monom) (m2 monom))
Note:
See TracChangeset
for help on using the changeset viewer.