Loading...
Searching...
No Matches
Vdf_CompressedIndexMapping Class Reference

This collection of IndexBlockMappings is all the info required to take a logical index into a compressed VdfVector and obtain a raw index into packed storage. More...

#include <compressedIndexMapping.h>

Public Member Functions

VDF_API void Initialize (const VdfMask::Bits &bits)
 
VDF_API size_t FindDataIndex (size_t logicalIdx, size_t *blockHint) const
 
VDF_API size_t FindBlockIndex (size_t logicalIdx) const
 
VDF_API bool ComputeDataIndex (size_t blockIndex, size_t logicalIndex, size_t *dataIndex) const
 
VDF_API size_t GetBlockFirstIndex (size_t blockIdx) const
 
VDF_API size_t GetBlockLastIndex (size_t blockIdx) const
 
VDF_API size_t GetBlockLength (size_t blockIdx) const
 
VDF_API void FindBlockRange (size_t first, size_t last, size_t *firstBlockIdx, size_t *lastBlockIdx) const
 
size_t GetFirstIndex () const
 
size_t GetLastIndex () const
 
VDF_API void ComputeStoredBits (VdfMask::Bits *bits, size_t num) const
 

Friends

template<class T >
class Vdf_VectorImplCompressed
 

Detailed Description

This collection of IndexBlockMappings is all the info required to take a logical index into a compressed VdfVector and obtain a raw index into packed storage.

An example vector with letters representing significant values: logical vector: [ A BC DE ] logical indices: 0123456789

raw storage: [ABCDE]

Block mappings: (1,1), (3,3), (7,5)

The third block mapping (7,5) says the third contiguous block of data (D,E) begins in the logical vector at logical index 7, and that in the raw storage, it ends before raw index 5. To find the raw storage index corresponding to logical index 7, just look at the previous mapping's end index and find it's stored at raw index 3.

Using this scheme, the total number of stored elements is available as the end index of the last block mapping.

Definition at line 64 of file compressedIndexMapping.h.

Member Function Documentation

◆ GetFirstIndex()

size_t GetFirstIndex ( ) const
inline

Definition at line 110 of file compressedIndexMapping.h.

◆ GetLastIndex()

size_t GetLastIndex ( ) const
inline

Definition at line 115 of file compressedIndexMapping.h.

Friends And Related Function Documentation

◆ Vdf_VectorImplCompressed

friend class Vdf_VectorImplCompressed
friend

Definition at line 126 of file compressedIndexMapping.h.


The documentation for this class was generated from the following file: