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


Ignore:
Timestamp:
2015-06-10T06:31:34-07:00 (9 years ago)
Author:
Marek Rychlik
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/f4grobner/parse.lisp

    r1008 r1009  
    251251   (t (sort-poly-1 poly-or-poly-list order))))
    252252
    253 (defun poly-eval-1 (expr vars order ring
     253(defun poly-eval-1 (ring-and-order expr vars
    254254                    &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))))
    257258  "Evaluate an expression EXPR as polynomial by substituting operators
    258259+ - * expt with corresponding polynomial operators and variables VARS
     
    265266     (cond
    266267       ((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)))))
    268269    ((symbolp expr)
    269270     (nth (position expr vars) basis))
     
    272273       (expt
    273274        (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)
    275276                        (caddr expr)
    276                         n order ring)
     277                        n)
    277278            (error "Too many arguments to EXPT")))
    278279       (/
    279280        (if (and (= (length expr) 3)
    280281                 (numberp (caddr expr)))
    281             ($poly/ (cadr expr) (caddr expr) ring)
     282            ($poly/ ring (cadr expr) (caddr expr))
    282283            (error "The second argument to / must be a number")))
    283284       (otherwise
Note: See TracChangeset for help on using the changeset viewer.