#include <nmrMultiIndexCounter.h>
Enumerator |
---|
COUNTER_UNDERFLOW |
|
COUNTER_IN_BOUNDS |
|
COUNTER_OVERFLOW |
|
COUNTER_UNDEFINED |
|
nmrMultiIndexCounter::nmrMultiIndexCounter |
( |
unsigned int |
size | ) |
|
void nmrMultiIndexCounter::Decrement |
( |
| ) |
|
Decrement the counter by the values specified in SetIncements(). The last index changes fastest. When an index gets below the low bound, the previous index is decremented, and if there was an index that was decremented successfully, all the subsequent indices are wrapped back to their high bounds. When no index can be incremented, the status is set to COUNTER_UNDERFLOW.
Note that when the status is COUNTER_UNDERFLOW, the indices are not determined, as the loop semantics is using <= rather than <. In the current implementation, COUNTER_UNDERFLOW is reached with all indices below their low bounds. Yet this may change in future versions. One should not assume anything about a counter in COUNTER_OVERFLOW or COUNTER_UNDERFLOW status.
IndexType nmrMultiIndexCounter::GetHighBound |
( |
unsigned int |
counter | ) |
const |
|
inline |
const IndexType* nmrMultiIndexCounter::GetHighBounds |
( |
| ) |
const |
|
inline |
IndexType nmrMultiIndexCounter::GetIncrement |
( |
unsigned int |
counter | ) |
const |
|
inline |
const IndexType* nmrMultiIndexCounter::GetIncrements |
( |
| ) |
const |
|
inline |
const IndexType* nmrMultiIndexCounter::GetIndexCells |
( |
| ) |
const |
|
inline |
const unsigned int* nmrMultiIndexCounter::GetIndexCellsAsUnsigned |
( |
| ) |
const |
|
inline |
IndexType nmrMultiIndexCounter::GetLowBound |
( |
unsigned int |
counter | ) |
const |
|
inline |
const IndexType* nmrMultiIndexCounter::GetLowBounds |
( |
| ) |
const |
|
inline |
unsigned long nmrMultiIndexCounter::GetNumberOfCombinations |
( |
| ) |
const |
return the total number of possible states, or combinations, of the counter.
unsigned int nmrMultiIndexCounter::GetSize |
( |
void |
| ) |
const |
|
inline |
return one of UNDERLOW, COUNTER_IN_BOUNDS, COUNTER_OVERFLOW, COUNTER_UNDEFINED
void nmrMultiIndexCounter::GoTo |
( |
const IndexType |
where[] | ) |
|
|
inline |
void nmrMultiIndexCounter::GoToHighBounds |
( |
| ) |
|
|
inline |
void nmrMultiIndexCounter::GoToLowBounds |
( |
| ) |
|
|
inline |
Set the counter to the low bounds specified in SetBounds(). Set the status to COUNTER_IN_BOUNDS.
void nmrMultiIndexCounter::Increment |
( |
| ) |
|
Increment the counter by the values specified in SetIncements(). The last index changes fastest. When an index passes the high bound, the previous index is incremented, and if there was an index that was incremented successfully, all the subsequent indices are wrapped back to their low bounds. When no index can be incremented, the status is set to COUNTER_OVERFLOW.
Note that when the status is COUNTER_OVERFLOW, the indices are not determined, as the loop semantics is using <= rather than <. In the current implementation, COUNTER_OVERFLOW is reached with all indices above their high bounds. Yet this may change in future versions. One should not assume anything about a counter in COUNTER_OVERFLOW or COUNTER_UNDERFLOW status.
Compare the index cells of to multi-index counters. The method does not compare bounds, increments, etc.
bool nmrMultiIndexCounter::IsAboveLowBounds |
( |
| ) |
const |
|
inline |
return true if the status is defined and LowBounds <= Index
bool nmrMultiIndexCounter::IsBelowHighBounds |
( |
| ) |
const |
|
inline |
return true if the status is defined and Index <= HighBounds
bool nmrMultiIndexCounter::IsBetweenBounds |
( |
| ) |
const |
|
inline |
Return true of the status is COUNTER_IN_BOUNDS
IndexType nmrMultiIndexCounter::operator[] |
( |
unsigned int |
i | ) |
const |
|
inline |
void nmrMultiIndexCounter::SetAllIncrements |
( |
IndexType |
increment | ) |
|
|
inline |
void nmrMultiIndexCounter::SetBounds |
( |
const IndexType |
lowBounds[], |
|
|
const IndexType |
highBounds[] |
|
) |
| |
|
inline |
void nmrMultiIndexCounter::SetHighBound |
( |
unsigned int |
counter, |
|
|
IndexType |
bound |
|
) |
| |
|
inline |
void nmrMultiIndexCounter::SetIncrement |
( |
unsigned int |
counter, |
|
|
IndexType |
increment |
|
) |
| |
|
inline |
void nmrMultiIndexCounter::SetIncrements |
( |
const IndexType |
increments[] | ) |
|
|
inline |
void nmrMultiIndexCounter::SetIndex |
( |
unsigned int |
cell, |
|
|
IndexType |
value |
|
) |
| |
|
inline |
void nmrMultiIndexCounter::SetLowBound |
( |
unsigned int |
counter, |
|
|
IndexType |
bound |
|
) |
| |
|
inline |
void nmrMultiIndexCounter::UpdateStatus |
( |
| ) |
|
|
inline |
const IndexType nmrMultiIndexCounter::DefaultIncrement |
|
static |
The documentation for this class was generated from the following file: