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 241


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

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/f4grobner/mx-grobner.lisp

    r237 r241  
    161161;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    162162;;
     163;; Conversion from internal form to Maxima general form
     164;;
     165;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
     166
     167(defun maxima-head ()
     168  (if $poly_return_term_list
     169      '(mlist)
     170    '(mplus)))
     171
     172(defun coerce-to-maxima (poly-type object vars)
     173  (case poly-type
     174    (:polynomial
     175     `(,(maxima-head) ,@(mapcar #'(lambda (term) (coerce-to-maxima :term term vars)) (poly-termlist object))))
     176    (:poly-list
     177     `((mlist) ,@(mapcar #'(lambda (p) (funcall *ratdisrep-fun* (coerce-to-maxima :polynomial p vars))) object)))
     178    (:term
     179     `((mtimes) ,(funcall *ratdisrep-fun* (term-coeff object))
     180       ,@(mapcar #'(lambda (var power) `((mexpt) ,var ,power))
     181                 vars (monom-exponents (term-monom object)))))
     182    ;; Assumes that Lisp and Maxima logicals coincide
     183    (:logical object)
     184    (otherwise
     185     object)))
     186
     187
     188;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
     189;;
    163190;; Unary and binary operation definition facility
    164191;;
Note: See TracChangeset for help on using the changeset viewer.