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


Ignore:
Timestamp:
2016-05-30T00:37:06-07:00 (8 years ago)
Author:
Marek Rychlik
Message:

* empty log message *

File:
1 edited

Legend:

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

    r3944 r3945  
    8888  ((pq :initform nil :initarg :pq :accessor pq :type priority-queue)))
    8989
    90 (defmethod initialize-instance :after ((self critical-pair-queue) &key)
     90(defmethod initialize-instance :after ((self critical-pair-queue) &key (f nil) (start 0))
    9191  (with-accessors ((pair-key-fn pair-key-fn)
    9292                   (pair-order-fn pair-order-fn)
     
    9696                :element-type 'critical-pair
    9797                :element-key #'(lambda (pair) (funcall pair-key-fn (critical-pair-first pair) (critical-pair-second pair)))
    98                 :test pair-order-fn))))
     98                :test pair-order-fn))
     99    (let* ((s (1- (length f)))
     100           (b (nconc (makelist (make-instance 'critical-pair :first (elt f i) :second (elt f j))
     101                               (i 0 (1- start)) (j start s))
     102                     (makelist (make-instance 'critical-pair :first (elt f i) :second (elt f j))
     103                               (i start (1- s)) (j (1+ i) s)))))
     104      (dolist (pair b pq)
     105        (priority-queue-insert pq pair)))
     106    ))
    99107
    100108(defmethod print-object ((self critical-pair-queue) stream)
Note: See TracChangeset for help on using the changeset viewer.