- Timestamp:
- 2015-06-09T14:24:57-07:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/f4grobner/order.lisp
r904 r910 108 108 (return-from invlex> (values nil nil)))))) 109 109 110 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;111 ;;112 ;; Some globally-defined variables holding monomial orders113 ;; and related macros/functions.114 ;;115 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;116 110 117 (defvar *monomial-order* #'lex> 118 "Default order for monomial comparisons. This global variable holds 119 the order which is in effect when performing polynomial 120 arithmetic. The global order is called by the macro MONOMIAL-ORDER, 121 which is somewhat more elegant than FUNCALL.") 122 123 (defun monomial-order (x y) 124 "Calls the global monomial order function, held by *MONOMIAL-ORDER*." 125 (funcall *monomial-order* x y)) 126 127 (defun reverse-monomial-order (x y) 128 "Calls the inverse monomial order to the global monomial order function, 129 held by *MONOMIAL-ORDER*." 130 (monomial-order y x)) 111 (defun reverse-monomial-order (order) 112 "Create the inverse monomial order to the given monomial order ORDER." 113 #'(lambda (x y) (funcall order y x))) 131 114 132 115 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; … … 136 119 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 137 120 138 (defun elimination-order (primary-elimination-order secondary-elimination-order k) 139 "Return a predicate which compares monomials according to the 140 K-th elimination order. The monomial orders PRIMARY-ELIMINATION-ORDER 141 and SECONDARY-ELIMINATION-ORDER control the behavior on the first K 142 and the remaining variables, respectively." 143 #'(lambda (p q &optional (start 0) (end (monom-dimension p))) 144 (multiple-value-bind (primary equal) 145 (funcall primary-elimination-order p q start k) 146 (if equal 147 (funcall secondary-elimination-order p q k end) 148 (values primary nil))))) 121 (defun make-elimination-order-maker (primary-elimination-order secondary-elimination-order) 122 "Return a function with a single integer argument K. This should be 123 the number of initial K variables X[0],X[1],...,X[K-1], which precede 124 remaining variables. The call to the closure creates a predicate 125 which compares monomials according to the K-th elimination order. The 126 monomial orders PRIMARY-ELIMINATION-ORDER and 127 SECONDARY-ELIMINATION-ORDER are used to compare the first K and the 128 remaining variables, respectively, with ties broken by lexicographical 129 order. That is, if PRIMARY-ELIMINATION-ORDER yields (VALUES NIL T), 130 which indicates that the first K variables appear with identical 131 powers, then the result is that of a call to 132 SECONDARY-ELIMINATION-ORDER applied to the remaining variables 133 X[K],X[K+1],..." 134 #'(lambda (k) 135 #'(lambda (p q &optional (start 0) (end (monom-dimension p))) 136 (multiple-value-bind (primary equal) 137 (funcall primary-elimination-order p q start k) 138 (if equal 139 (funcall secondary-elimination-order p q k end) 140 (values primary nil)))))) 149 141 150 142 (defun elimination-order-1 (secondary-elimination-order q &optional (start 0) (end (monom-dimension p)))
Note:
See TracChangeset
for help on using the changeset viewer.