Changeset 1115 for branches/f4grobner
- Timestamp:
- 2015-06-10T12:39:34-07:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/f4grobner/polynomial.lisp
r1114 r1115 279 279 (print expr) 280 280 ;; A polynomial can be divided by a scalar 281 (cond ((endp (cddr expr)) 282 ;; A special case (/ x) 283 (apply (ring-div ring) (cdr expr))) 284 ((endp (cdddr expr)) 285 (let ((num (p-eval (cadr expr))) 286 (denom-inverse (p-eval-scalar (cons '/ (last expr))))) 287 (scalar-times-poly ring denom-inverse num))) 288 (t 289 (let ((num (p-eval (cons '* (cdr (butlast expr))))) 290 (denom (p-eval-scalar (cons '/ (last expr))))) 291 (cons num denom))))) 281 (cond 282 ((endp (cddr expr)) 283 ;; A special case (/ x) 284 (apply (ring-div ring) (cdr expr))) 285 ((endp (cdddr expr)) 286 (let ((num (p-eval (cadr expr))) 287 (denom-inverse (p-eval-scalar (cons '/ (last expr))))) 288 (scalar-times-poly ring denom-inverse num))) 289 (t 290 (let ((num (p-eval (cons '* (cdr (butlast expr))))) 291 (denom (p-eval-scalar (cons '/ (last expr))))) 292 (cons num denom))))) 292 293 (expt 293 294 (cond
Note:
See TracChangeset
for help on using the changeset viewer.