Changeset 3940 for branches/f4grobner
- Timestamp:
- 2016-05-29T23:51:29-07:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/f4grobner/pair-queue.lisp
r3939 r3940 54 54 55 55 (defclass selection-strategy () 56 ((pair-key-fn :initform (error "Must specify PAIR-KEY-FN") :initarg :pair-key-fn :accessor pair-key-fn) 57 (pair-order-fn :initform (error "Must specify PAIR-ORDER-FN") :initarg :pair-order-fn :accessor pair-order-fn)) 58 (:documentation "Represents a critical pair selection strategy. The 59 two ingredients of a strategy is a function PAIR-KEY-FUNCTION which 60 computes a key from the critical pair, which can be any type of data, 61 and a function PAIR-ORDER-FN used to compaire the calculated keys to 62 determine which pair is more promising and should be considered first.")) 56 ((pair-key-fn :initform #'(lambda (p q) (universal-lcm (leading-monomial p) (leading-monomial q)))) 57 (pair-order-fn :initform #'lex>)) 58 (:documentation "Represents the normal critical pair selection 59 strategy. The two ingredients of a strategy is a function 60 PAIR-KEY-FUNCTION which computes a key from the critical pair, which 61 can be any type of data, and a function PAIR-ORDER-FN used to compaire 62 the calculated keys to determine which pair is more promising and 63 should be considered first. 64 The normal selection strategy for a given monomial order PAIR-ORDER-FN consists in 65 selecting the pair with the minimal LCM of leading monomials first.")) 63 66 64 67 (defmethod print-object ((self selection-strategy) stream) … … 69 72 (format stream "PAIR-KEY-FN=~A PAIR-ORDER-FN=~A" 70 73 pair-key-fn pair-order-fn)))) 71 72 (defclass normal-selection-strategy (selection-strategy)73 ((pair-key-fn :initform #'(lambda (p q) (universal-lcm (leading-monomial p) (leading-monomial q))))74 (pair-order-fn :initform #'lex>))75 (:documentation "The normal selection strategy for a given monomial order MONOMIAL-ORDER-FN. A pair76 with the minimal LCM of leading monomials is selected."))77 74 78 75 (defclass min-total-degree-strategy (selection-strategy) … … 89 86 90 87 (defclass critical-pair-queue (selection-strategy) 91 ((pq : type priority-queue)))88 ((pq :initform nil :initarg :pq :accessor pq :type priority-queue))) 92 89 93 90 (defmethod initialize-instance :after ((self critical-pair-queue) &key) 94 (with-slots (pair-key-fn pair-order-fn pq) 91 (with-accessors ((pair-key-fn pair-key-fn) 92 (pair-order-fn pair-order-fn) 93 (pq pq)) 95 94 (setf pq (make-priority-queue 96 95 :element-type 'critical-pair
Note:
See TracChangeset
for help on using the changeset viewer.