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 104 for branches


Ignore:
Timestamp:
2015-06-05T12:01:49-07:00 (9 years ago)
Author:
Marek Rychlik
Message:

* empty log message *

File:
1 edited

Legend:

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

    r103 r104  
    7171are assumed to be defined.")
    7272
    73 
    74 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    75 ;;
    76 ;; Order utilities
    77 ;;
    78 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    79 (defun find-order (order)
    80   "This function returns the order function bases on its name."
    81   (cond
    82    ((null order) nil)
    83    ((symbolp order)
    84     (case order
    85       ((lex :lex $lex) #'lex>)
    86       ((grlex :grlex $grlex) #'grlex>)
    87       ((grevlex :grevlex $grevlex) #'grevlex>)
    88       ((invlex :invlex $invlex) #'invlex>)
    89       ((elimination-order-1 :elimination-order-1 elimination_order_1) #'elimination-order-1)
    90       (otherwise
    91        (mtell "~%Warning: Order ~M not found. Using default.~%" order))))
    92    (t
    93     (mtell "~%Order specification ~M is not recognized. Using default.~%" order)
    94     nil)))
    95 
    96 (defun find-ring (ring)
    97   "This function returns the ring structure bases on input symbol."
    98   (cond
    99    ((null ring) nil)
    100    ((symbolp ring)
    101     (case ring
    102       ((expression-ring :expression-ring $expression_ring) *expression-ring*)
    103       ((ring-of-integers :ring-of-integers $ring_of_integers) *ring-of-integers*)
    104       (otherwise
    105        (mtell "~%Warning: Ring ~M not found. Using default.~%" ring))))
    106    (t
    107     (mtell "~%Ring specification ~M is not recognized. Using default.~%" ring)
    108     nil)))
    109 
    110 (defmacro with-monomial-order ((order) &body body)
    111   "Evaluate BODY with monomial order set to ORDER."
    112   `(let ((*monomial-order* (or (find-order ,order) *monomial-order*)))
    113      . ,body))
    114 
    115 (defmacro with-coefficient-ring ((ring) &body body)
    116   "Evaluate BODY with coefficient ring set to RING."
    117   `(let ((*maxima-ring* (or (find-ring ,ring) *maxima-ring*)))
    118      . ,body))
    119 
    120 (defmacro with-elimination-orders ((primary secondary elimination-order)
    121                                    &body body)
    122   "Evaluate BODY with primary and secondary elimination orders set to PRIMARY and SECONDARY."
    123   `(let ((*primary-elimination-order* (or (find-order ,primary)  *primary-elimination-order*))
    124          (*secondary-elimination-order* (or (find-order ,secondary) *secondary-elimination-order*))
    125          (*elimination-order* (or (find-order ,elimination-order) *elimination-order*)))
    126      . ,body))
    12773
    12874
Note: See TracChangeset for help on using the changeset viewer.