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 3354


Ignore:
Timestamp:
2015-07-16T11:06:13-07:00 (9 years ago)
Author:
Marek Rychlik
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/f4grobner/symbolic-polynomial.lisp

    r3353 r3354  
    5656  (assert (= (length (symbolic-poly-vars new)) (poly-dimension new))))
    5757
    58 
    59 (defun poly-eval (expr vars
    60                   &optional
    61                     (order #'lex>)
    62                     (list-marker :[))
    63   "Evaluate Lisp form EXPR to a polynomial or a list of polynomials in
     58(defgeneric poly-eval (expr)
     59  (:documentation "Evaluate Lisp form EXPR to a polynomial or a list of polynomials in
    6460variables VARS. Return the resulting polynomial or list of
    6561polynomials.  Standard arithmetical operators in form EXPR are
     
    6763resulting expression is evaluated, resulting in a polynomial or a list
    6864of polynomials in internal form. A similar operation in another computer
    69 algebra system could be called 'expand' or so."
    70   (labels ((p-eval (arg) (poly-eval arg vars order))
    71            (p-eval-scalar (arg) (poly-eval-scalar arg))
    72            (p-eval-list (args) (mapcar #'p-eval args))
    73            (p-add (x y) (poly-add ring-and-order x y)))
    74     (cond
    75       ((null expr) (error "Empty expression"))
    76       ((eql expr 0) (make-poly-zero))
     65algebra system could be called 'expand' or so.")
     66  (:method ((expr symbolic-poly)) expr)
     67  (:method (expr)
     68    (cond
     69      ((eq expr 0)
     70       (make-instance 'symbolic-poly :dimension (length vars) :vars vars))
    7771      ((member expr vars :test #'equalp)
    7872       (let ((pos (position expr vars :test #'equalp)))
Note: See TracChangeset for help on using the changeset viewer.