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 3940


Ignore:
Timestamp:
2016-05-29T23:51:29-07:00 (8 years ago)
Author:
Marek Rychlik
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/f4grobner/pair-queue.lisp

    r3939 r3940  
    5454
    5555(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
     59strategy.  The two ingredients of a strategy is a function
     60PAIR-KEY-FUNCTION which computes a key from the critical pair, which
     61can be any type of data, and a function PAIR-ORDER-FN used to compaire
     62the calculated keys to determine which pair is more promising and
     63should be considered first.
     64The normal selection strategy for a given monomial order PAIR-ORDER-FN consists in
     65selecting the pair with the minimal LCM of leading monomials first."))
    6366
    6467(defmethod print-object ((self selection-strategy) stream)
     
    6972      (format stream "PAIR-KEY-FN=~A PAIR-ORDER-FN=~A"
    7073              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."))
    7774
    7875(defclass min-total-degree-strategy (selection-strategy)
     
    8986
    9087(defclass critical-pair-queue (selection-strategy)
    91   ((pq :type priority-queue)))
     88  ((pq :initform nil :initarg :pq :accessor pq :type priority-queue)))
    9289
    9390(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))
    9594      (setf pq (make-priority-queue
    9695                :element-type 'critical-pair
Note: See TracChangeset for help on using the changeset viewer.