Changeset 3932
- Timestamp:
- 2016-05-29T23:30:31-07:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/f4grobner/pair-queue.lisp
r3931 r3932 54 54 55 55 (defclass selection-strategy () 56 ((pair-key-fn :initform nil:initarg :pair-key-fn :accessor pair-key-fn)57 (pair-order-fn :initform nil:initarg :pair-order-fn :accessor pair-order-fn))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 58 (:documentation "Represents a critical pair selection strategy. The 59 59 two ingredients of a strategy is a function PAIR-KEY-FUNCTION which … … 62 62 determine which pair is more promising and should be considered first.")) 63 63 64 (defclass critical-pair-queue (selection-strategy) 64 (defmethod print-object ((self selection-strategy) stream) 65 (print-unreadable-object (self stream :type t :identity t) 66 (with-accessors ((pair-key-fn pair-key-fn) 67 (pair-order-fn pair-order-fn)) 68 self 69 (format stream "PAIR-KEY-FN=~A PAIR-ORDER-FN=~A" 70 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 pair 76 with the minimal LCM of leading monomials is selected.")) 77 78 79 (defclass critical-pair-queue () 65 80 ((pq :initform (make-priority-queue 66 81 :element-type 'critical-pair … … 95 110 96 111 97 (defun make-normal-strategy (monomial-order-fn)98 "Make a normal selection strategy for a given monomial order MONOMIAL-ORDER-FN. A pair99 with the minimal LCM of leading monomials is selected."100 (make-instance 'selection-strategy101 :pair-key-fn #'(lambda (p q) (universal-lcm (leading-monomial p) (leading-monomial q)))102 :pair-order-fn monomial-order-fn))103 112 104 113 (defun make-min-total-degree-strategy ()
Note:
See TracChangeset
for help on using the changeset viewer.