- Timestamp:
- 2015-07-16T11:06:13-07:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/f4grobner/symbolic-polynomial.lisp
r3353 r3354 56 56 (assert (= (length (symbolic-poly-vars new)) (poly-dimension new)))) 57 57 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 64 60 variables VARS. Return the resulting polynomial or list of 65 61 polynomials. Standard arithmetical operators in form EXPR are … … 67 63 resulting expression is evaluated, resulting in a polynomial or a list 68 64 of 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)) 65 algebra 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)) 77 71 ((member expr vars :test #'equalp) 78 72 (let ((pos (position expr vars :test #'equalp)))
Note:
See TracChangeset
for help on using the changeset viewer.