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 4456 for branches/f4grobner


Ignore:
Timestamp:
2016-06-13T10:13:06-07:00 (9 years ago)
Author:
Marek Rychlik
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/f4grobner/polynomial.lisp

    r4455 r4456  
    2828           "POLY-TERM-ORDER"
    2929           "POLY-INSERT-TERM"
     30           "POLY-REMOVE-TERM"
    3031           "SCALAR-MULTIPLY-BY"
    3132           "SCALAR-DIVIDE-BY"
     
    124125    self))
    125126
     127(defgeneric poly-remove-term (object)
     128  (:documentation "Remove leading term of polynomial OBJECT. Returns the removed term.")
     129  (:method ((object poly))
     130    (pop (poly-termlist object))))
     131
    126132(defgeneric poly-append-term (self term)
    127133  (:documentation "Append a term TERM to SELF after all other terms. Order is not enforced.")
     
    160166
    161167
     168#+nil
     169(defmethod shared-initialize :after ((self poly) slot-names
     170                                     &rest initargs
     171                                     &key)
     172  "If TERMLIST is supplied and non-empty, and DIMENSION is NIL, set
     173the dimension to the dimension of the first term in TERMLIST."
     174  (declare (ignore initargs))
     175  (let ((dims (mapcar #'monom-dimension (slot-value self 'termlist))))
     176    (format t "Dimensions: ~A~%" dims)
     177    (assert (apply #'= dims))
     178    (unless (endp dims)
     179      (setf (slot-value self 'dimension) (car dims))))
     180  self)
    162181
    163182(defmethod update-instance-for-different-class :after ((old term) (new poly) &key)
Note: See TracChangeset for help on using the changeset viewer.