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 222


Ignore:
Timestamp:
2015-06-05T15:36:03-07:00 (9 years ago)
Author:
Marek Rychlik
Message:

* empty log message *

File:
1 edited

Legend:

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

    r219 r222  
    255255  "Returns the polynomial P divided by the leading coefficient.")
    256256
     257;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
     258;;
     259;; Macro facility for writing Maxima-level wrappers for
     260;; functions operating on internal representation
     261;;
     262;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
     263
     264(defmacro with-parsed-polynomials (((maxima-vars &optional (maxima-new-vars nil new-vars-supplied-p))
     265                                    &key (polynomials nil)
     266                                         (poly-lists nil)
     267                                         (poly-list-lists nil)
     268                                         (value-type nil))
     269                                   &body body
     270                                   &aux (vars (gensym))
     271                                        (new-vars (gensym)))
     272  `(let ((,vars (coerce-maxima-list ,maxima-vars))
     273         ,@(when new-vars-supplied-p
     274             (list `(,new-vars (coerce-maxima-list ,maxima-new-vars)))))
     275     (coerce-to-maxima
     276      ,value-type
     277      (with-coefficient-ring ($poly_coefficient_ring)
     278        (with-monomial-order ($poly_monomial_order)
     279          (with-elimination-orders ($poly_primary_elimination_order
     280                                    $poly_secondary_elimination_order
     281                                    $poly_elimination_order)
     282            (let ,(let ((args nil))
     283                    (dolist (p polynomials args)
     284                      (setf args (cons `(,p (parse-poly ,p ,vars)) args)))
     285                    (dolist (p poly-lists args)
     286                      (setf args (cons `(,p (parse-poly-list ,p ,vars)) args)))
     287                    (dolist (p poly-list-lists args)
     288                      (setf args (cons `(,p (parse-poly-list-list ,p ,vars)) args))))
     289              . ,body))))
     290      ,(if new-vars-supplied-p
     291           `(append ,vars ,new-vars)
     292         vars))))
     293
     294
    257295;;Functions
    258296
Note: See TracChangeset for help on using the changeset viewer.