![]() |
ICF 3.1.1.10
Technical documentation of ICF Libraries
|
Multidimensional index used to addressing index. More...
#include <CVarIndex.h>
Public Types | |
| typedef int | IndexType |
| typedef QVector< int > | Elements |
| typedef Elements::iterator | iterator |
Public Member Functions | |
| CVarIndex () | |
| Default constructor without member initialization. | |
| CVarIndex (int size, int value=0) | |
| Constructor initializing all member to specified value. | |
| CVarIndex (const CVarIndex &index) | |
| Copy constructor. | |
| CVarIndex (const std::vector< IndexType > &values) | |
| Construct index from std::vector. | |
| CVarIndex (const Elements &values) | |
| Construct index from QVector. | |
| template<int Dimensions> | |
| CVarIndex (const TIndex< Dimensions > index) | |
| Convert fixed-size index to this object. | |
| std::vector< int > | ToStdVector () const |
| bool | IsValid () const |
| Check if tihs index is valid. | |
| bool | IsZero () const |
| Check if this index point at zero element. | |
| bool | IsSizeEmpty () const |
| Check if this index interpreted as size is empty. | |
| void | Reset () |
| Reset this object. | |
| void | Clear () |
| Set all components to 0. | |
| bool | IsDimensionsCountFixed () const |
| Check, if number dimensions is fixed. | |
| int | GetDimensionsCount () const |
| Get number of dimensions of this index. | |
| bool | SetDimensionsCount (int count, int value=0) |
| Set number of dimensions of this index. | |
| int | GetAt (int index) const |
| Get element stored at specified index. | |
| void | SetAt (int index, int value) |
| Set element at specified index. | |
| void | SetAllTo (int value) |
| Set all components to specified value. | |
| bool | IncreaseAt (int index) |
| Increase single component at specified position. | |
| bool | DecreaseAt (int index) |
| Decrease single component at specified position. | |
| bool | IsInside (const CVarIndex &boundaries) const |
| Check if index is inside boundaries. | |
| bool | Increase (const CVarIndex &boundaries) |
| Increase this index inside the boundaries. | |
| bool | Decrease (const CVarIndex &boundaries) |
| Decrese this index inside the boundaries. | |
| int | GetProductVolume () const |
| Get total number of elements if this index is treated as size. | |
| int | GetIterationIndex (const CVarIndex &boundaries) const |
| Get index of iteration from zero to current index inside some boundaries. | |
| int | GetMinDimensionsCount () const |
| Get minimal number of dimensions needed to to represent this index. | |
| istd::CVarIndex | GetExpanded (const istd::CVarIndex &other) const |
| Get the index expanded by another index. | |
| iterator | Begin () const |
| Get begin value of element access iterator. | |
| iterator | End () const |
| Get end value of element access iterator. | |
| int | operator[] (int index) const |
| Get access to single index components. | |
| int & | operator[] (int index) |
| Get access to single index components. | |
| bool | operator== (const CVarIndex &index) const |
| bool | operator!= (const CVarIndex &index) const |
| bool | operator< (const CVarIndex &index) const |
| bool | operator> (const CVarIndex &index) const |
| bool | operator<= (const CVarIndex &index) const |
| bool | operator>= (const CVarIndex &index) const |
| CVarIndex & | operator= (const CVarIndex &index) |
| CVarIndex & | operator+= (const CVarIndex &index) |
| CVarIndex & | operator-= (const CVarIndex &index) |
Multidimensional index used to addressing index.
Definition at line 26 of file CVarIndex.h.
| QVector<int> istd::CVarIndex::Elements |
Definition at line 30 of file CVarIndex.h.
Definition at line 29 of file CVarIndex.h.
| Elements::iterator istd::CVarIndex::iterator |
Definition at line 31 of file CVarIndex.h.
| istd::CVarIndex::CVarIndex | ( | ) |
Default constructor without member initialization.
|
explicit |
Constructor initializing all member to specified value.
| istd::CVarIndex::CVarIndex | ( | const CVarIndex & | index | ) |
Copy constructor.
| istd::CVarIndex::CVarIndex | ( | const std::vector< IndexType > & | values | ) |
Construct index from std::vector.
| istd::CVarIndex::CVarIndex | ( | const Elements & | values | ) |
Construct index from QVector.
| istd::CVarIndex::CVarIndex | ( | const TIndex< Dimensions > | index | ) |
Convert fixed-size index to this object.
Definition at line 433 of file CVarIndex.h.
|
inline |
Get begin value of element access iterator.
Please refer to general description of ICF iterators, STL iterators or Qt iterators concept.
Definition at line 334 of file CVarIndex.h.
| void istd::CVarIndex::Clear | ( | ) |
Set all components to 0.
| bool istd::CVarIndex::Decrease | ( | const CVarIndex & | boundaries | ) |
Decrese this index inside the boundaries.
Please note, that the number of dimensions for this index will not be changed and this operation can be unclear when number of dimensions differs from boundaries number of dimensions.
|
inline |
Decrease single component at specified position.
| index | index of component should be increased. It must be valid. |
Definition at line 285 of file CVarIndex.h.
|
inline |
Get end value of element access iterator.
Please refer to general description of ICF iterators, STL iterators or Qt iterators concept.
Definition at line 340 of file CVarIndex.h.
|
inline |
Get element stored at specified index.
Definition at line 256 of file CVarIndex.h.
Referenced by GetMinDimensionsCount(), GetProductVolume(), and operator[]().
|
inline |
Get number of dimensions of this index.
Definition at line 236 of file CVarIndex.h.
Referenced by istd::TVarArray< Element >::GetDimensionsCount(), istd::TVarArray< Element >::GetElementIndex(), GetMinDimensionsCount(), and GetProductVolume().
|
inline |
Get the index expanded by another index.
Definition at line 324 of file CVarIndex.h.
| int istd::CVarIndex::GetIterationIndex | ( | const CVarIndex & | boundaries | ) | const |
Get index of iteration from zero to current index inside some boundaries.
|
inline |
Get minimal number of dimensions needed to to represent this index.
In other words this is index of last non-zero component + 1.
Definition at line 310 of file CVarIndex.h.
References GetAt(), and GetDimensionsCount().
|
inline |
Get total number of elements if this index is treated as size.
Definition at line 296 of file CVarIndex.h.
References GetAt(), and GetDimensionsCount().
| bool istd::CVarIndex::Increase | ( | const CVarIndex & | boundaries | ) |
Increase this index inside the boundaries.
Please note, that the number of dimensions for this index will not be changed and this operation can be unclear when number of dimensions differs from boundaries number of dimensions.
|
inline |
Increase single component at specified position.
| index | index of component should be increased. It must be valid. |
Definition at line 274 of file CVarIndex.h.
|
inline |
Check, if number dimensions is fixed.
It is provided for template implementations. It returns always false.
Definition at line 230 of file CVarIndex.h.
| bool istd::CVarIndex::IsInside | ( | const CVarIndex & | boundaries | ) | const |
Check if index is inside boundaries.
Index is inside boundaries, if all its components are smaller than according boundary components.
Referenced by istd::TVarArray< Element >::GetAt(), istd::TVarArray< Element >::iterator::iterator(), and istd::TVarArray< Element >::SetAt().
| bool istd::CVarIndex::IsSizeEmpty | ( | ) | const |
Check if this index interpreted as size is empty.
It means, it returns true, is some of components is less or equal 0.
| bool istd::CVarIndex::IsValid | ( | ) | const |
Check if tihs index is valid.
Index is valid if it has elements and all elements are not negative.
| bool istd::CVarIndex::IsZero | ( | ) | const |
Check if this index point at zero element.
In other words, it checks if all components are 0.
| bool istd::CVarIndex::operator!= | ( | const CVarIndex & | index | ) | const |
|
inline |
Definition at line 362 of file CVarIndex.h.
|
inline |
Definition at line 396 of file CVarIndex.h.
| bool istd::CVarIndex::operator== | ( | const CVarIndex & | index | ) | const |
|
inline |
Definition at line 379 of file CVarIndex.h.
|
inline |
Definition at line 413 of file CVarIndex.h.
|
inline |
Get access to single index components.
Definition at line 352 of file CVarIndex.h.
|
inline |
Get access to single index components.
Definition at line 346 of file CVarIndex.h.
References GetAt().
| void istd::CVarIndex::Reset | ( | ) |
Reset this object.
For this (variable size) implementation, it set dimension size to 0.
| void istd::CVarIndex::SetAllTo | ( | int | value | ) |
Set all components to specified value.
|
inline |
Set element at specified index.
Definition at line 265 of file CVarIndex.h.
|
inline |
Set number of dimensions of this index.
It is provided to allows template implementations to use fixed-size or variable arrays.
| count | number of dimensions will be set. |
Definition at line 242 of file CVarIndex.h.
|
inline |
Definition at line 64 of file CVarIndex.h.
© Witold Gantzke and Kirill Lepskiy