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 3518


Ignore:
Timestamp:
2015-09-05T11:56:48-07:00 (9 years ago)
Author:
Marek Rychlik
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/f4grobner/polynomial.lisp

    r3517 r3518  
    155155
    156156;; Testing for a zero polynomial
    157 (defmethod r-zerop ((self poly))
    158   (null (poly-termlist self)))
     157(defgeneric poly-zerop (self)
     158  (:method ((self poly))
     159    (null (poly-termlist self))))
    159160
    160161;; The number of terms
    161 (defmethod r-length ((self poly))
    162   (length (poly-termlist self)))
    163 
    164 (defmethod multiply-by ((self poly) (other monom))
    165   (mapc #'(lambda (term) (multiply-by term other))
    166         (poly-termlist self))
    167   self)
    168 
    169 (defmethod multiply-by ((self poly) other)
    170   (mapc #'(lambda (term) (multiply-by term other))
    171         (poly-termlist self))
    172   self)
     162(defgeneric poly-length (self)
     163  (:method ((self poly))
     164    (length (poly-termlist self))))
     165
     166(defgeneric poly-multiply-by (self other)
     167  (:method ((self poly) (other monom))
     168    (mapc #'(lambda (term) (monom-multiply-by term other))
     169          (poly-termlist self))
     170    self))
    173171
    174172(defmacro fast-add/subtract (p q order-fn add/subtract-fn uminus-fn)
Note: See TracChangeset for help on using the changeset viewer.