Changeset 1009
- Timestamp:
- 2015-06-10T06:31:34-07:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/f4grobner/parse.lisp
r1008 r1009 251 251 (t (sort-poly-1 poly-or-poly-list order)))) 252 252 253 (defun poly-eval-1 ( expr vars order ring253 (defun poly-eval-1 (ring-and-order expr vars 254 254 &aux 255 (n (length vars)) 256 (basis (monom-basis (length vars)))) 255 (ring (ro-ring ring-and-order)) 256 (n (length vars)) 257 (basis (monom-basis (length vars)))) 257 258 "Evaluate an expression EXPR as polynomial by substituting operators 258 259 + - * expt with corresponding polynomial operators and variables VARS … … 265 266 (cond 266 267 ((zerop expr) NIL) 267 (t ( list (cons (make-list n :initial-element 0) expr)))))268 (t (make-poly-from-termlist (list (make-monom :dimension n) expr))))) 268 269 ((symbolp expr) 269 270 (nth (position expr vars) basis)) … … 272 273 (expt 273 274 (if (= (length expr) 3) 274 ($poly-expt (poly-eval-1 (cadr expr) vars order ring)275 ($poly-expt (poly-eval-1 ring-and-order (cadr expr) vars) 275 276 (caddr expr) 276 n order ring)277 n) 277 278 (error "Too many arguments to EXPT"))) 278 279 (/ 279 280 (if (and (= (length expr) 3) 280 281 (numberp (caddr expr))) 281 ($poly/ (cadr expr) (caddr expr) ring)282 ($poly/ ring (cadr expr) (caddr expr)) 282 283 (error "The second argument to / must be a number"))) 283 284 (otherwise
Note:
See TracChangeset
for help on using the changeset viewer.