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


Ignore:
Timestamp:
2016-06-02T23:22:12-07:00 (8 years ago)
Author:
Marek Rychlik
Message:

* empty log message *

File:
1 edited

Legend:

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

    r4147 r4149  
    3737  ((element-type :initarg :element-type
    3838                 :initform 'fixnum
    39                  :reader priority-queue-element-type
     39                 :accessor priority-queue-element-type
    4040                 :type symbol
    4141                 :documentation "Element type stored in this queue.")
    4242   (test :initarg :test
    43          :reader priority-queue-test
     43         :accessor priority-queue-test
    4444         :documentation "The partial order used in element comparison.")
    4545   (heap :documentation "A private slot holding the heap."))
     
    4747Slots HEAP and TEST are read-only after they are initialized."))
    4848
     49
    4950(defmethod initialize-instance :after ((self priority-queue)
    5051                                       &key
    5152                                         (test #'<=)
    5253                                         (element-key #'identity))
     54  (format t "PRIORITY-QUEUE::INITIALIZE-INSTANCE :AROUND~%")
    5355  (with-slots (heap (test-x test) element-type)
    54       self
     56      (call-next-method)
    5557    (setf heap (make-heap :element-type element-type)
    56           test-x #'(lambda (x y) (funcall test (funcall element-key y) (funcall element-key x))))))
     58          test-x #'(lambda (x y) (funcall test (funcall element-key y) (funcall element-key x)))))
     59  self)
    5760 
    5861(defgeneric enqueue (self item)
Note: See TracChangeset for help on using the changeset viewer.