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


Ignore:
Timestamp:
2015-06-09T20:51:31-07:00 (9 years ago)
Author:
Marek Rychlik
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/f4grobner/polynomial.lisp

    r988 r989  
    240240                           0))
    241241
    242 (defun poly-eval (ring expr vars &optional (list-marker '[))
    243   (labels ((p-eval (arg) (poly-eval ring arg vars))
     242(defun poly-eval (ring-and-order expr vars &optional (list-marker '[)
     243                                             &aux (ring (ro-ring ring-and-order)))
     244  (labels ((p-eval (arg) (poly-eval ring-and-order arg vars))
    244245           (p-eval-list (args) (mapcar #'p-eval args))
    245            (p-add (x y) (poly-add ring x y)))
     246           (p-add (x y) (poly-add ring-and-order x y)))
    246247    (cond
    247248      ((eql expr 0) (make-poly-zero))
     
    259260              (1 (make-poly-zero))
    260261              (2 (poly-uminus ring (p-eval (cadr expr))))
    261               (3 (poly-sub ring (p-eval (cadr expr)) (p-eval (caddr expr))))
    262               (otherwise (poly-sub ring (p-eval (cadr expr))
     262              (3 (poly-sub ring-and-order (p-eval (cadr expr)) (p-eval (caddr expr))))
     263              (otherwise (poly-sub ring-and-order (p-eval (cadr expr))
    263264                                   (reduce #'p-add (p-eval-list (cddr expr)))))))
    264265         (*
    265266          (if (endp (cddr expr))                ;unary
    266267              (p-eval (cdr expr))
    267               (reduce #'(lambda (p q) (poly-mul ring p q)) (p-eval-list (cdr expr)))))
     268              (reduce #'(lambda (p q) (poly-mul ring-and-order p q)) (p-eval-list (cdr expr)))))
    268269         (expt
    269270          (cond
     
    276277             ;; Non-integer power means non-polynomial coefficient
    277278             (coerce-coeff ring expr vars))
    278             (t (poly-expt ring (p-eval (cadr expr)) (caddr expr)))))
     279            (t (poly-expt ring-and-order (p-eval (cadr expr)) (caddr expr)))))
    279280         (otherwise
    280281          (coerce-coeff ring expr vars)))))))
Note: See TracChangeset for help on using the changeset viewer.