- Timestamp:
- 2016-06-02T23:22:12-07:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/f4grobner/priority-queue.lisp
r4147 r4149 37 37 ((element-type :initarg :element-type 38 38 :initform 'fixnum 39 : reader priority-queue-element-type39 :accessor priority-queue-element-type 40 40 :type symbol 41 41 :documentation "Element type stored in this queue.") 42 42 (test :initarg :test 43 : reader priority-queue-test43 :accessor priority-queue-test 44 44 :documentation "The partial order used in element comparison.") 45 45 (heap :documentation "A private slot holding the heap.")) … … 47 47 Slots HEAP and TEST are read-only after they are initialized.")) 48 48 49 49 50 (defmethod initialize-instance :after ((self priority-queue) 50 51 &key 51 52 (test #'<=) 52 53 (element-key #'identity)) 54 (format t "PRIORITY-QUEUE::INITIALIZE-INSTANCE :AROUND~%") 53 55 (with-slots (heap (test-x test) element-type) 54 self56 (call-next-method) 55 57 (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) 57 60 58 61 (defgeneric enqueue (self item)
Note:
See TracChangeset
for help on using the changeset viewer.