3.5 Heap data structure
Among the tools routines of sec. 6, we have a number of sorting utilities; the heap
sort is implemented in terms of heaps having the following signatures:
- : a heap containing elements of type T, where T can be i,s,c,d,z
for integer, real and complex data;
- : a heap containing elements of type T, as above, together
with an integer index.
Given a heap object, the following methods are defined on it:
- Initialize memory; also choose ascending or descending order;
- Current heap occupancy;
- Add an item (or an item and its index);
- Remove and return the first element;
- Print on file;
- Release memory.
These objects are used in AMG4PSBLAS to implement the factorization algorithms.