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 240


Ignore:
Timestamp:
2015-06-05T16:09:22-07:00 (10 years ago)
Author:
Marek Rychlik
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/f4grobner/ngrobner.lisp

    r223 r240  
    251251    (warn "~%Ring specification ~A is not recognized. Using default.~%" ring)
    252252    nil)))
    253 
    254 
    255 
    256 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    257 ;;
    258 ;; Conversion from internal form to Maxima general form
    259 ;;
    260 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    261 
    262 (defun maxima-head ()
    263   (if $poly_return_term_list
    264       '(mlist)
    265     '(mplus)))
    266 
    267 (defun coerce-to-maxima (poly-type object vars)
    268   (case poly-type
    269     (:polynomial
    270      `(,(maxima-head) ,@(mapcar #'(lambda (term) (coerce-to-maxima :term term vars)) (poly-termlist object))))
    271     (:poly-list
    272      `((mlist) ,@(mapcar #'(lambda (p) (funcall *ratdisrep-fun* (coerce-to-maxima :polynomial p vars))) object)))
    273     (:term
    274      `((mtimes) ,(funcall *ratdisrep-fun* (term-coeff object))
    275        ,@(mapcar #'(lambda (var power) `((mexpt) ,var ,power))
    276                  vars (monom-exponents (term-monom object)))))
    277     ;; Assumes that Lisp and Maxima logicals coincide
    278     (:logical object)
    279     (otherwise
    280      object)))
    281 
    282 
    283 
Note: See TracChangeset for help on using the changeset viewer.