Changeset 104
- Timestamp:
- 2015-06-05T12:01:49-07:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/f4grobner/mx-grobner.lisp
r103 r104 71 71 are assumed to be defined.") 72 72 73 74 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;75 ;;76 ;; Order utilities77 ;;78 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;79 (defun find-order (order)80 "This function returns the order function bases on its name."81 (cond82 ((null order) nil)83 ((symbolp order)84 (case order85 ((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 (otherwise91 (mtell "~%Warning: Order ~M not found. Using default.~%" order))))92 (t93 (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 (cond99 ((null ring) nil)100 ((symbolp ring)101 (case ring102 ((expression-ring :expression-ring $expression_ring) *expression-ring*)103 ((ring-of-integers :ring-of-integers $ring_of_integers) *ring-of-integers*)104 (otherwise105 (mtell "~%Warning: Ring ~M not found. Using default.~%" ring))))106 (t107 (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))127 73 128 74
Note:
See TracChangeset
for help on using the changeset viewer.