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 3923 for branches


Ignore:
Timestamp:
2016-05-29T22:27:23-07:00 (8 years ago)
Author:
Marek Rychlik
Message:

* empty log message *

File:
1 edited

Legend:

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

    r3922 r3923  
    9090to determine the priority of critical pairs in the priority queue.")
    9191  ((pair-key-fn :initform nil :accessor pair-key-fn)
    92    (pair-order-fn :initform nil :
     92   (pair-order-fn :initform nil :accessor monomial-order-fn)))
    9393
    94   (ecase method
    95     ((minimal-lcm :minimal-lcm $minimal_lcm)
    96      (setf *pair-key-function* #'(lambda (p q)
    97                                    (universal-lcm (leading-monomial p) (leading-monomial q)))
    98            *pair-order* #'reverse-monomial-order))
    99     ((minimal-total-degree :minimal-total-degree $minimal_total_degree)
    100      (setf *pair-key-function* #'(lambda (p q)
    101                                    (total-degree
    102                                     (universal-lcm (leading-monomial p) (leading-monomial q))))
    103            *pair-order* #'<))
    104     ((minimal-length :minimal-length $minimal_length)
    105      (setf *pair-key-function* #'(lambda (p q)
    106                                    (+ (poly-length p) (poly-length q)))
    107            *pair-order* #'<))))
     94(defun make-normal-strategy (monomial-order-fn)
     95  "Make a normal selection strategy for a given monomial order. A pair
     96with the minimal LCM of leading monomials is selected."
     97  (make-instance 'selection-strategy
     98                 :pair-key-fn #'(lambda (p q) (universal-lcm (leading-monomial p) (leading-monomial q)))
     99                 :pair-order-fn #'monomial-order-fn))
    108100
     101(defun make-min-total-degree-strategy ()
     102  "Make a selection strategy where a pair with a minimum total degree of LCM
     103of leading monomials is selected."
     104  (make-instance 'selection-strategy
     105                 :pair-key-fn #'(lambda (p q) (total-degree (universal-lcm (leading-monomial p) (leading-monomial q))))
     106                 :pair-order* #'<))
     107
     108(defun make-minimal-length-strategy ()
     109  "Make a selection strategy where a pair with the minimum combined length of both
     110polynomials is selected."
     111  (make-instance 'selection-strategy
     112                 :pair-key-fn #'(lambda (p q) (+ (poly-length p) (poly-length q)))
     113                 :pair-order #'<))
     114
Note: See TracChangeset for help on using the changeset viewer.