|
ADS
Algorithms and Data Structures
|
Files | |
| BlockBTree.h | |
| The B-tree of chapter 14 of Morin's book, beyond the book, on a BlockStore [see BlockStore.h]: a SORTED SET whose nodes are blocks of the external memory, each read and written by one I/O, and whose lowerBound( x ) (the smallest key \( \ge x \), the find( x ) of the SSet of the book), insert() and remove() take \( O( \log_B n ) \) I/Os, \( O( B \log_B n ) \) time with a binary search in each node. | |
| BlockStore.h | |
| The store of blocks of section 14.1 of Morin's book, beyond the book: a disk simulated in memory, an array of blocks of type T addressed by their index, on which readBlock( i ) and writeBlock( i , b ) are the I/Os of the external memory model [see TwoLevelMemory.h], counted one each; placeBlock( b ) writes a new block where a block freed by freeBlock( i ) was, or at the end, so that the indices of the blocks in use stay below their largest number. | |
| ExternalSorting.h | |
| The sort of \( n \) atomic items in the two-level memory [see TwoLevelMemory.h], by merging and by distribution, with the lower bounds that make both optimal, written as functions that a test can compare with the I/Os counted. | |
| ListRanking.h | |
| The ranking of a list, the distance of each item from the tail, in the memory and in the two-level memory [see TwoLevelMemory.h], following chapter 4, List Ranking, of Ferragina's book. | |
| MappedFile.h | |
| A file mapped in memory, shared by the structures that are read from it in place [see Persistence.h]: with ADS_WITH_BOOST, MappedFile maps a whole file by Boost.Interprocess in its mode copy_on_write (the private and writable mapping of every system), so that a page is read from the disk at its first access and a page that a structure writes is copied for the process and never reaches the file; without Boost, the file is read whole into a block aligned to a page, on which the views are made in the same way. | |
| Persistence.h | |
| The persistence of the static structures of ADS, beyond the book: a structure built once (a succinct index, a filter, a minimal perfect hash function, a graph in CSR form) is written to a file, a stream or a buffer by store(), and read back by restore(), or opened in place by restoreMapped(), which maps the file [see MappedFile.h] and makes the large arrays of the structure views over its bytes, with no copy and no parsing, so that an index of any size is opened in \( O( 1 ) \) time and its pages are read from the disk at their first access. | |
| RecordFile.h | |
| Files of records on a real disk, for the algorithms whose data do not fit in the internal memory and are read and written by sequential scans only (e.g., the searches with delayed duplicate detection, whose open and closed lists are kept on the disk): where TwoLevelMemory.h simulates the model of Aggarwal and Vitter to count its I/Os, these files are on the file system of the machine, and what they cost is the time of the disk. | |
| TwoLevelMemory.h | |
| The two-level memory model of Aggarwal and Vitter, simulated so that the algorithms of the external memory can be run and their I/Os counted: an internal memory of \( M \) items and a disk of unbounded size, read and written by blocks of \( B \) items, an I/O moving one block. | |