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 3630


Ignore:
Timestamp:
2015-09-05T20:24:38-07:00 (9 years ago)
Author:
Marek Rychlik
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/f4grobner/polynomial.lisp

    r3629 r3630  
    135135  (:documentation "The leading term of a polynomial, or NIL for zero polynomial."))
    136136
    137 ;; Second term
    138137(defgeneric second-leading-term (object)
    139138  (:method ((self poly))
     
    141140  (:documentation "The second leading term of a polynomial, or NIL for a polynomial with at most one term."))
    142141
    143 ;; Leading coefficient
    144142(defgeneric leading-coefficient (object)
    145143  (:method ((self poly))
     
    158156  (null (poly-termlist self))))
    159157
    160 ;; The number of terms
    161158(defgeneric poly-length (self)
     159  (:documentation "Return the number of terms.")
    162160  (:method ((self poly))
    163161    (length (poly-termlist self))))
    164162
    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)
    172168
    173169(defmacro fast-add/subtract (p q order-fn add/subtract-fn uminus-fn)
Note: See TracChangeset for help on using the changeset viewer.