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


Ignore:
Timestamp:
2015-09-07T19:41:37-07:00 (9 years ago)
Author:
Marek Rychlik
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/f4grobner/symbolic-polynomial.lisp

    r3728 r3729  
    8787        (t
    8888         (case (car expr)
    89            (+ (reduce #'r+ (p-eval-list (cdr expr))))
    90            (- (apply #'r- (p-eval-list (cdr expr))))
     89           (+ (reduce #'add (p-eval-list (cdr expr))))
     90           (- (apply #'subtract (p-eval-list (cdr expr))))
    9191           (*
    9292            (if (endp (cddr expr))      ;unary
    9393                (p-eval (cdr expr))
    94                 (reduce #'r* (p-eval-list (cdr expr)))))
     94                (reduce #'multiply (p-eval-list (cdr expr)))))
    9595           (/
    9696            ;; A polynomial can be divided by a scalar
     
    9898              ((endp (cddr expr))
    9999               ;; A special case (/ ?), the inverse
    100                (r/ (cadr expr)))
     100               (divide (cadr expr)))
    101101              (t
    102102               (let ((num (p-eval (cadr expr)))
    103                      (denom-inverse (apply #'r/ (mapcar #'p-eval-scalar (cddr expr)))))
    104                  (r* denom-inverse num)))))
     103                     (denom-inverse (apply #'divide (mapcar #'p-eval-scalar (cddr expr)))))
     104                 (multiply denom-inverse num)))))
    105105           (expt
    106106            (cond
     
    113113               ;; Non-integer power means non-polynomial coefficient
    114114               expr)
    115               (t (r-expt (p-eval (cadr expr)) (caddr expr)))))
     115              (t (universal-expt (p-eval (cadr expr)) (caddr expr)))))
    116116           (otherwise
    117117            expr)))))))
     
    184184  (cond
    185185    ((poly-p p)
    186      (mapcar #'term->cons (poly-termlist p)))
     186     (mapcar #'->list (poly-termlist p)))
    187187    ((and (consp p) (eq (car p) :[))
    188188     (cons :[ (mapcar #'poly->alist (cdr p))))))
     
    193193  "Convert a string STR representing a polynomial or polynomial list to
    194194an association list (... (MONOM . COEFF) ...)."
    195   (poly->alist (string->poly str vars ring order)))
     195  (poly->alist (string->poly str vars order)))
    196196
    197197(defun poly-equal-no-sugar-p (p q)
Note: See TracChangeset for help on using the changeset viewer.