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 3502


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

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/f4grobner/polynomial.lisp

    r3501 r3502  
    120120    self))
    121121
    122 (defmethod append-item ((self poly) (item term))
    123   (cond ((null (poly-dimension self))
    124          (setf (poly-dimension self) (monom-dimension item)))
    125         (t (assert (= (poly-dimension self) (monom-dimension item)))))
    126   (setf (cdr (last (poly-termlist self))) (list item))
    127   self)
     122(defgeneric poly-append-term (self monom coeff)
     123  (:method ((self poly) (monom monom) coeff)
     124    (cond ((null (poly-dimension self))
     125           (setf (poly-dimension self) (monom-dimension monom)))
     126          (t (assert (= (poly-dimension self) (monom-dimension monom)))))
     127    (setf (cdr (last (poly-termlist self))) (list (cons monom coeff)))
     128    self))
    128129
    129130;; Leading term
     
    413414  ;; of each termlist.
    414415  (flet ((subtract-1 (p)
    415            (append-item p (make-instance 'term :coeff -1 :dimension nvars))))
     416           (append-item p (make-instance 'monom :coeff -1 :dimension nvars))))
    416417    (setf plist (mapc #'subtract-1 plist)))
    417418  plist)
Note: See TracChangeset for help on using the changeset viewer.