This is the pileup Reference Manual, version 1.0.1, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Dec 15 07:17:22 2024 GMT+0.
The main system appears first, followed by any subsystem dependency.
pileup
A portable, performant, and thread-safe binary heap / priority queue.
Nikodemus Siivola <nikodemus@random-state.net>
MIT
1.0.1
alexandria
(system).
package.lisp
(file).
pileup.lisp
(file).
readme
(file).
licence
(file).
Files are sorted by type and then listed depth-first from the systems components trees.
pileup/pileup.lisp
package.lisp
(file).
pileup
(system).
heap
(structure).
heap-count
(function).
heap-delete
(function).
heap-empty-p
(function).
heap-insert
(function).
heap-key
(function).
heap-name
(function).
(setf heap-name)
(function).
heap-pop
(function).
heap-predicate
(function).
heap-size
(function).
heap-size-limit
(constant).
heap-top
(function).
make-heap
(compiler macro).
make-heap
(function).
map-heap
(function).
print-object
(method).
with-locked-heap
(macro).
%heap-delete
(function).
*two-arg-predicates*
(special variable).
+empty+
(constant).
check-heap-clean
(function).
heap-%count
(reader).
(setf heap-%count)
(writer).
heap-%key
(reader).
heap-%name
(reader).
(setf heap-%name)
(writer).
heap-%predicate
(reader).
heap-%size
(reader).
(setf heap-%size)
(writer).
heap-%vector
(reader).
(setf heap-%vector)
(writer).
heap-fast-pred
(reader).
heap-lock
(reader).
heap-state
(reader).
(setf heap-state)
(writer).
make-heap-using-fast-pred
(function).
make-heap-vector
(function).
max-heap-size
(constant).
two-arg-<
(function).
two-arg-<=
(function).
two-arg->
(function).
two-arg->=
(function).
Packages are listed by definition order.
pileup
Pileup provides a thread-safe binary heap implementation.
alexandria
.
common-lisp
.
heap
(structure).
heap-count
(function).
heap-delete
(function).
heap-empty-p
(function).
heap-insert
(function).
heap-key
(function).
heap-name
(function).
(setf heap-name)
(function).
heap-pop
(function).
heap-predicate
(function).
heap-size
(function).
heap-size-limit
(constant).
heap-top
(function).
make-heap
(compiler macro).
make-heap
(function).
map-heap
(function).
with-locked-heap
(macro).
%heap-delete
(function).
*two-arg-predicates*
(special variable).
+empty+
(constant).
check-heap-clean
(function).
heap-%count
(reader).
(setf heap-%count)
(writer).
heap-%key
(reader).
heap-%name
(reader).
(setf heap-%name)
(writer).
heap-%predicate
(reader).
heap-%size
(reader).
(setf heap-%size)
(writer).
heap-%vector
(reader).
(setf heap-%vector)
(writer).
heap-fast-pred
(reader).
heap-lock
(reader).
heap-state
(reader).
(setf heap-state)
(writer).
make-heap-using-fast-pred
(function).
make-heap-vector
(function).
max-heap-size
(constant).
two-arg-<
(function).
two-arg-<=
(function).
two-arg->
(function).
two-arg->=
(function).
Definitions are sorted by export status, category, package, and then by lexicographic order.
Exclusive upper limit for heap size, based on ARRAY-DIMENSION-LIMIT.
When an insertion is attempted and the heap cannot grow any further, an error
is signaled.
Executes BODY with HEAP locked. Heap operations which implicitly lock the heap are: HEAP-INSERT, HEAP-POP, HEAP-DELETE, and MAP-HEAP. Allows grouping multiple heap operations into atomic units.
Returns the number of objects in the heap.
Removes elements of the HEAP EQL to ELT. Returns T if one or more elements
were found and removed, NIL otherwise.
If COUNT is NIL (the default), removes all elements EQL to ELT, otherwise at
most the indicated number.
Locks the heap during its operation unless the current thread is already holding the heap lock via WITH-LOCKED-HEAP.
Returns true if the heap is empty, that is iff HEAP-COUNT is zero.
Insert ELT to HEAP. Returns ELT.
Locks the heap during its operation unless the current thread is already holding the heap lock via WITH-LOCKED-HEAP.
Returns the heap key, a function one argument used to extract values for use by the heap predicate. Heap key may also be NIL, meaning heap elements are used directly by the heap predicate.
Returns the name of the heap. Heap name affects only printed representation of the heap. Can be changed using SETF unlike other heap properties.
Removes and returns the element at the top of the HEAP and a secondary value of T.
Should the heap be empty, both the primary and the secondary values are NIL.
Locks the heap during its operation unless the current thread is already holding the heap lock via WITH-LOCKED-HEAP.
Returns the heap predicate, a function of two arguments, returning true if the first argument should be closer to te top of the heap than the second.
Returns the reserved size of the heap. Note, this is not the same as the number of elements in the heap: see HEAP-COUNT for comparison.
Returns the element at the top of the HEAP without removing it, and a secondary value of T. Should the heap be empty, both the primary and the secondary values are NIL.
Constructs a HEAP.
The PREDICATE determines the ordering of the heap. It must be a function of two
arguments, returning true if the first argument should be closer to top of the
heap than the second. If a predicate signals an error and causes a non-local
exit from a heap operation, it may leave the heap in an inconsistent state and
cause a subsequent heap operation to signal an error.
If KEY is not NIL, it must be a function of one argument, and is used to
extract values for use by PREDICATE for comparison.
The NAME can be used to optionally specify a name for the heap: it affects only
printing of the heap.
The SIZE is the size of the storage initially reserved for the heap. Specifying size is not necessary: the heap will grow as necessary, but a reasonable estimate can improve performance by eliminating unnecessary copying by allocating sufficient storage immediately.
Calls FUNCTION for each element in heap. Returns the heap.
If ORDERED is true (the default), processes the elements in heap order from
top down.
If ORDERED is false, uses unordered traversal. Unordered traversal is faster
and also works on heaps that have been corrupted by eg. the heap predicate
performing a non-local exit from a heap operation.
Attempts to insert or delete elements to the heap from FUNCTION will cause
an error to be signalled.
Locks the heap during its operation unless the current thread is already holding the heap lock via WITH-LOCKED-HEAP.
A thread-safe binary heap.
Heap operations which need the heap to remain consistent heap lock it. Users
can also group multiple heap operations into atomic units using
WITH-LOCKED-HEAP.
Thread-safety is implemented using a single lock per heap. While Pileup heaps
are fine for threaded use, a more specialized solution is recommended when the
heap is highly contested between multiple threads.
Important: Pileup heaps are not asynch-unwind safe: asynchronous interrupts
causing non-local exits may leave the heap in an inconsistent state or lose
data. Do not use INTERRUPT-THREAD or asychronous timeouts with Pileup.
All slot names in HEAP are internal to the PILEUP package, so it is safe to subclass using eg. DEFSTRUCT :INCLUDE, as long as only the exported operations are used to accessor or modify heap state.
structure-object
.
simple-vector
(alexandria:required-argument :vector)
alexandria:array-index
0
alexandria:array-index
(alexandria:required-argument :%size)
function
(alexandria:required-argument :predicate)
This slot is read-only.
function
(alexandria:required-argument :fast-pred)
This slot is read-only.
(sb-thread:make-mutex :name "heap lock")
This slot is read-only.
(member :clean :dirty :traverse)
:clean
Jump to: | %
(
C F H M P T W |
---|
Jump to: | %
(
C F H M P T W |
---|
Jump to: | %
*
+
C F H L M S |
---|
Jump to: | %
*
+
C F H L M S |
---|
Jump to: | F H L P R S |
---|
Jump to: | F H L P R S |
---|