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


Ignore:
Timestamp:
2015-06-10T12:39:34-07:00 (10 years ago)
Author:
Marek Rychlik
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/f4grobner/polynomial.lisp

    r1114 r1115  
    279279          (print expr)
    280280          ;; 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)))))
    292293         (expt
    293294          (cond
Note: See TracChangeset for help on using the changeset viewer.