HOG2
Public Member Functions | Private Attributes | List of all members
NBitArray< numBits > Class Template Reference

This class supports compact n-bit arrays. More...

#include <NBitArray.h>

Public Member Functions

 NBitArray (uint64_t numEntries=0)
 
 NBitArray (const char *)
 
 NBitArray (const NBitArray &copyMe)
 
 ~NBitArray ()
 
NBitArrayoperator= (const NBitArray &copyMe)
 
bool Equal (const NBitArray &compare) const
 
void FillMax ()
 
void Clear ()
 
void Resize (uint64_t newMaxEntries)
 
uint64_t Size () const
 
uint64_t Get (uint64_t index) const
 
void Set (uint64_t index, uint64_t val)
 
uint64_t GetMaxValue () const
 
bool Write (FILE *)
 
bool Read (FILE *)
 
bool Write (const char *)
 
bool Read (const char *)
 
uint64_t GetMaxValue () const
 
uint64_t Get (uint64_t index) const
 
uint64_t Get (uint64_t index) const
 
uint64_t Get (uint64_t index) const
 
uint64_t Get (uint64_t index) const
 
uint64_t Get (uint64_t index) const
 
void Set (uint64_t index, uint64_t val)
 
void Set (uint64_t index, uint64_t val)
 
void Set (uint64_t index, uint64_t val)
 
void Set (uint64_t index, uint64_t val)
 
void Set (uint64_t index, uint64_t val)
 
uint64_t Get (uint64_t index) const
 
uint64_t Get (uint64_t index) const
 
uint64_t Get (uint64_t index) const
 
uint64_t Get (uint64_t index) const
 
uint64_t Get (uint64_t index) const
 
void Set (uint64_t index, uint64_t val)
 
void Set (uint64_t index, uint64_t val)
 
void Set (uint64_t index, uint64_t val)
 
void Set (uint64_t index, uint64_t val)
 
void Set (uint64_t index, uint64_t val)
 

Private Attributes

uint64_t * mem
 
uint64_t entries
 
uint64_t memorySize
 

Detailed Description

template<uint64_t numBits>
class NBitArray< numBits >

This class supports compact n-bit arrays.

For (1 <= n <= 64). It is efficient for powers of two, but less so for non-powers of two. (Currently about 3x slower.)

Definition at line 23 of file NBitArray.h.

Constructor & Destructor Documentation

◆ NBitArray() [1/3]

template<uint64_t numBits>
NBitArray< numBits >::NBitArray ( uint64_t  numEntries = 0)

Definition at line 58 of file NBitArray.h.

◆ NBitArray() [2/3]

template<uint64_t numBits>
NBitArray< numBits >::NBitArray ( const char *  file)

Definition at line 67 of file NBitArray.h.

◆ NBitArray() [3/3]

template<uint64_t numBits>
NBitArray< numBits >::NBitArray ( const NBitArray< numBits > &  copyMe)

Definition at line 75 of file NBitArray.h.

◆ ~NBitArray()

template<uint64_t numBits>
NBitArray< numBits >::~NBitArray

Definition at line 85 of file NBitArray.h.

Member Function Documentation

◆ Clear()

template<uint64_t numBits>
void NBitArray< numBits >::Clear

Definition at line 129 of file NBitArray.h.

◆ Equal()

template<uint64_t numBits>
bool NBitArray< numBits >::Equal ( const NBitArray< numBits > &  compare) const

Definition at line 104 of file NBitArray.h.

Referenced by operator==().

◆ FillMax()

template<uint64_t numBits>
void NBitArray< numBits >::FillMax

Definition at line 123 of file NBitArray.h.

Referenced by Hexagon::Load().

◆ Get() [1/11]

uint64_t NBitArray< 64 >::Get ( uint64_t  index) const

Definition at line 21 of file NBitArray.cpp.

◆ Get() [2/11]

uint64_t NBitArray< 32 >::Get ( uint64_t  index) const

Definition at line 27 of file NBitArray.cpp.

◆ Get() [3/11]

uint64_t NBitArray< 16 >::Get ( uint64_t  index) const

Definition at line 33 of file NBitArray.cpp.

◆ Get() [4/11]

template<uint64_t numBits>
uint64_t NBitArray< numBits >::Get ( uint64_t  index) const

◆ Get() [5/11]

uint64_t NBitArray< 2 >::Get ( uint64_t  index) const

Definition at line 51 of file NBitArray.cpp.

◆ Get() [6/11]

uint64_t NBitArray< 1 >::Get ( uint64_t  index) const

Definition at line 57 of file NBitArray.cpp.

◆ Get() [7/11]

uint64_t NBitArray< 64 >::Get ( uint64_t  index) const

◆ Get() [8/11]

uint64_t NBitArray< 32 >::Get ( uint64_t  index) const

◆ Get() [9/11]

uint64_t NBitArray< 16 >::Get ( uint64_t  index) const

◆ Get() [10/11]

uint64_t NBitArray< 2 >::Get ( uint64_t  index) const

◆ Get() [11/11]

uint64_t NBitArray< 1 >::Get ( uint64_t  index) const

◆ GetMaxValue() [1/2]

uint64_t NBitArray< 64 >::GetMaxValue ( ) const

Definition at line 13 of file NBitArray.cpp.

◆ GetMaxValue() [2/2]

template<uint64_t numBits>
uint64_t NBitArray< numBits >::GetMaxValue ( ) const
inline

◆ operator=()

template<uint64_t numBits>
NBitArray< numBits > & NBitArray< numBits >::operator= ( const NBitArray< numBits > &  copyMe)

Definition at line 91 of file NBitArray.h.

◆ Read() [1/2]

template<uint64_t numBits>
bool NBitArray< numBits >::Read ( const char *  file)

Definition at line 195 of file NBitArray.h.

◆ Read() [2/2]

template<uint64_t numBits>
bool NBitArray< numBits >::Read ( FILE *  f)

Definition at line 163 of file NBitArray.h.

Referenced by NBitArray< 8 >::NBitArray().

◆ Resize()

template<uint64_t numBits>
void NBitArray< numBits >::Resize ( uint64_t  newMaxEntries)

◆ Set() [1/11]

template<uint64_t numBits>
void NBitArray< numBits >::Set ( uint64_t  index,
uint64_t  val 
)

◆ Set() [2/11]

void NBitArray< 64 >::Set ( uint64_t  index,
uint64_t  val 
)

Definition at line 65 of file NBitArray.cpp.

◆ Set() [3/11]

void NBitArray< 32 >::Set ( uint64_t  index,
uint64_t  val 
)

Definition at line 71 of file NBitArray.cpp.

◆ Set() [4/11]

void NBitArray< 16 >::Set ( uint64_t  index,
uint64_t  val 
)

Definition at line 79 of file NBitArray.cpp.

◆ Set() [5/11]

void NBitArray< 2 >::Set ( uint64_t  index,
uint64_t  val 
)

Definition at line 104 of file NBitArray.cpp.

◆ Set() [6/11]

void NBitArray< 1 >::Set ( uint64_t  index,
uint64_t  val 
)

Definition at line 113 of file NBitArray.cpp.

◆ Set() [7/11]

void NBitArray< 64 >::Set ( uint64_t  index,
uint64_t  val 
)

◆ Set() [8/11]

void NBitArray< 32 >::Set ( uint64_t  index,
uint64_t  val 
)

◆ Set() [9/11]

void NBitArray< 16 >::Set ( uint64_t  index,
uint64_t  val 
)

◆ Set() [10/11]

void NBitArray< 2 >::Set ( uint64_t  index,
uint64_t  val 
)

◆ Set() [11/11]

void NBitArray< 1 >::Set ( uint64_t  index,
uint64_t  val 
)

◆ Size()

template<uint64_t numBits>
uint64_t NBitArray< numBits >::Size

◆ Write() [1/2]

template<uint64_t numBits>
bool NBitArray< numBits >::Write ( const char *  file)

Definition at line 181 of file NBitArray.h.

◆ Write() [2/2]

template<uint64_t numBits>
bool NBitArray< numBits >::Write ( FILE *  f)

Definition at line 150 of file NBitArray.h.

Member Data Documentation

◆ entries

template<uint64_t numBits>
uint64_t NBitArray< numBits >::entries
private

◆ mem

template<uint64_t numBits>
uint64_t* NBitArray< numBits >::mem
private

◆ memorySize

template<uint64_t numBits>
uint64_t NBitArray< numBits >::memorySize
private

Definition at line 47 of file NBitArray.h.

Referenced by NBitArray< 8 >::NBitArray(), and NBitArray< 8 >::operator=().


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