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 3997


Ignore:
Timestamp:
2016-05-30T21:22:49-07:00 (8 years ago)
Author:
Marek Rychlik
Message:

* empty log message *

File:
1 edited

Legend:

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

    r3993 r3997  
    3737  (:documentation "Representa a priority queue."))
    3838
    39 (defmethod initialize-instance ((self priority-queue)
     39(defmethod initialize-instance :after ((self priority-queue)
    4040                                &key
    4141                                  (element-type 'fixnum)
    4242                                  (test #'<=)
    4343                                  (element-key #'identity))
    44   (with-slots (heap test)
     44  (with-accessors ((heap priority-queue-heap)
     45                   (test-x priority-queue-test))
    4546      self
    4647    (setf heap (make-heap :element-type element-type)
    47           test #'(lambda (x y) (funcall test (funcall element-key y) (funcall element-key x))))))
     48          test-x #'(lambda (x y) (funcall test (funcall element-key y) (funcall element-key x))))))
    4849 
    4950(defgeneric enqueue (self item)
     
    5152    (with-slots (heap test)
    5253        self
    53     (heap-insert heap item test))))
     54      (heap-insert heap item test))
     55    self))
    5456
    5557(defgeneric dequeue (self)
Note: See TracChangeset for help on using the changeset viewer.