- Timestamp:
- 2015-09-05T20:24:38-07:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/f4grobner/polynomial.lisp
r3629 r3630 135 135 (:documentation "The leading term of a polynomial, or NIL for zero polynomial.")) 136 136 137 ;; Second term138 137 (defgeneric second-leading-term (object) 139 138 (:method ((self poly)) … … 141 140 (:documentation "The second leading term of a polynomial, or NIL for a polynomial with at most one term.")) 142 141 143 ;; Leading coefficient144 142 (defgeneric leading-coefficient (object) 145 143 (:method ((self poly)) … … 158 156 (null (poly-termlist self)))) 159 157 160 ;; The number of terms161 158 (defgeneric poly-length (self) 159 (:documentation "Return the number of terms.") 162 160 (:method ((self poly)) 163 161 (length (poly-termlist self)))) 164 162 165 (defgeneric poly-multiply-by (self other) 166 (:documentation "Multiply a polynomial SELF by OTHER.") 167 (:method ((self poly) (other monom)) 168 "Multiply a polynomial SELF by monomial OTHER" 169 (mapc #'(lambda (term) (cons (monom-multiply-by (car term) other) (cdr other))) 170 (poly-termlist self)) 171 self)) 163 (defmethod multiply-by ((self poly) (other monom)) 164 "Multiply a polynomial SELF by OTHER." 165 (mapc #'(lambda (term) (multiply-by term other)) 166 (poly-termlist self)) 167 self) 172 168 173 169 (defmacro fast-add/subtract (p q order-fn add/subtract-fn uminus-fn)
Note:
See TracChangeset
for help on using the changeset viewer.