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 910 for branches/f4grobner


Ignore:
Timestamp:
2015-06-09T14:24:57-07:00 (10 years ago)
Author:
Marek Rychlik
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/f4grobner/order.lisp

    r904 r910  
    108108          (return-from invlex> (values nil nil))))))
    109109
    110 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    111 ;;
    112 ;; Some globally-defined variables holding monomial orders
    113 ;; and related macros/functions.
    114 ;;
    115 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    116110
    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)))
    131114
    132115;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
     
    136119;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    137120
    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
     123the number of initial K variables X[0],X[1],...,X[K-1], which precede
     124remaining variables.  The call to the closure creates a predicate
     125which compares monomials according to the K-th elimination order. The
     126monomial orders PRIMARY-ELIMINATION-ORDER and
     127SECONDARY-ELIMINATION-ORDER are used to compare the first K and the
     128remaining variables, respectively, with ties broken by lexicographical
     129order. That is, if PRIMARY-ELIMINATION-ORDER yields (VALUES NIL T),
     130which indicates that the first K variables appear with identical
     131powers, then the result is that of a call to
     132SECONDARY-ELIMINATION-ORDER applied to the remaining variables
     133X[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))))))
    149141
    150142(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.