ICF 3.0.5.47
Technical documentation of ICF Libraries
istd::TIndex< Dimensions > Class Template Reference

Multidimensional index used to addressing fixed-size array. More...

#include <TIndex.h>

Inheritance diagram for istd::TIndex< Dimensions >:
Collaboration diagram for istd::TIndex< Dimensions >:

Public Types

enum  { DIMENSIONS = Dimensions }
 
typedef int IndexType
 
typedef int * iterator
 

Public Member Functions

 TIndex ()
 Default constructor with initialization of member to 0.
 
 TIndex (int value)
 Constructor initializing all members to specified value.
 
 TIndex (const TIndex &index)
 Copy constructor.
 
bool IsValid () const
 Check if this 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) const
 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 TIndex &boundaries) const
 Check if index is inside boundaries.
 
bool Increase (const TIndex &boundaries)
 Increase this index inside the boundaries.
 
bool Decrease (const TIndex &boundaries)
 Decrease this index inside the boundaries.
 
int GetProductVolume () const
 Get total number of elements if this index is treated as size.
 
int GetIterationIndex (const TIndex &boundaries) const
 Get index of iteration from zero to current index inside some boundaries.
 
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
 
int & operator[] (int index)
 
bool operator== (const TIndex &index) const
 
bool operator!= (const TIndex &index) const
 
TIndex operator+ (const TIndex &index) const
 
TIndexoperator+= (const TIndex &index)
 
TIndex operator- (const TIndex &index) const
 
TIndexoperator-= (const TIndex &index)
 

Static Public Member Functions

static const TIndex< Dimensions > & GetZero ()
 Get global instance of zero index.
 
static const TIndex< Dimensions > & GetInvalid ()
 Get global instance of invalid index.
 

Detailed Description

template<int Dimensions>
class istd::TIndex< Dimensions >

Multidimensional index used to addressing fixed-size array.

Definition at line 21 of file TIndex.h.

Member Typedef Documentation

◆ IndexType

template<int Dimensions>
int istd::TIndex< Dimensions >::IndexType

Definition at line 24 of file TIndex.h.

◆ iterator

template<int Dimensions>
int* istd::TIndex< Dimensions >::iterator

Definition at line 25 of file TIndex.h.

Member Enumeration Documentation

◆ anonymous enum

template<int Dimensions>
anonymous enum
Enumerator
DIMENSIONS 

Definition at line 27 of file TIndex.h.

Constructor & Destructor Documentation

◆ TIndex() [1/3]

template<int Dimensions>
istd::TIndex< Dimensions >::TIndex ( )

Default constructor with initialization of member to 0.

Definition at line 433 of file TIndex.h.

◆ TIndex() [2/3]

template<int Dimensions>
istd::TIndex< Dimensions >::TIndex ( int value)
explicit

Constructor initializing all members to specified value.

Definition at line 426 of file TIndex.h.

◆ TIndex() [3/3]

template<int Dimensions>
istd::TIndex< Dimensions >::TIndex ( const TIndex< Dimensions > & index)

Copy constructor.

Definition at line 442 of file TIndex.h.

Member Function Documentation

◆ Begin()

template<int Dimensions>
TIndex< Dimensions >::iterator istd::TIndex< Dimensions >::Begin ( ) const
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 316 of file TIndex.h.

Referenced by imath::TMultidimensionalPolynomial< Dimensions, Element >::Serialize().

◆ Clear()

template<int Dimensions>
void istd::TIndex< Dimensions >::Clear ( )
inline

Set all components to 0.

Definition at line 265 of file TIndex.h.

◆ Decrease()

template<int Dimensions>
bool istd::TIndex< Dimensions >::Decrease ( const TIndex< Dimensions > & boundaries)

Decrease this index inside the boundaries.

Returns
false, if decrease wasn't possible (e.g. overflow).

Definition at line 497 of file TIndex.h.

◆ DecreaseAt()

template<int Dimensions>
bool istd::TIndex< Dimensions >::DecreaseAt ( int index)
inline

Decrease single component at specified position.

Parameters
indexindex of component should be increased. It must be valid.
Returns
true if success. It is provided for template implementations. In this case it returns always true.

Definition at line 304 of file TIndex.h.

◆ End()

template<int Dimensions>
TIndex< Dimensions >::iterator istd::TIndex< Dimensions >::End ( ) const
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 323 of file TIndex.h.

◆ GetAt()

template<int Dimensions>
int istd::TIndex< Dimensions >::GetAt ( int index) const
inline

Get element stored at specified index.

Definition at line 272 of file TIndex.h.

Referenced by imath::TMultidimensionalPolynomial< Dimensions, Element >::GetBaseFunctionValue().

◆ GetDimensionsCount()

template<int Dimensions>
int istd::TIndex< Dimensions >::GetDimensionsCount ( ) const
inline

◆ GetInvalid()

template<int Dimensions>
const TIndex< Dimensions > & istd::TIndex< Dimensions >::GetInvalid ( )
static

Get global instance of invalid index.

Definition at line 560 of file TIndex.h.

◆ GetIterationIndex()

template<int Dimensions>
int istd::TIndex< Dimensions >::GetIterationIndex ( const TIndex< Dimensions > & boundaries) const

Get index of iteration from zero to current index inside some boundaries.

Definition at line 535 of file TIndex.h.

◆ GetProductVolume()

template<int Dimensions>
int istd::TIndex< Dimensions >::GetProductVolume ( ) const

Get total number of elements if this index is treated as size.

Returns
multiplication of all elements.

Definition at line 522 of file TIndex.h.

Referenced by imath::TMultidimensionalPolynomial< Dimensions, Element >::ApproximateCoefficientsFromFulcrums().

◆ GetZero()

template<int Dimensions>
const TIndex< Dimensions > & istd::TIndex< Dimensions >::GetZero ( )
static

Get global instance of zero index.

Definition at line 553 of file TIndex.h.

Referenced by ialgo::TGeneralHoughSpace< Dimensions, Element >::CombineWithSpace().

◆ Increase()

template<int Dimensions>
bool istd::TIndex< Dimensions >::Increase ( const TIndex< Dimensions > & boundaries)

◆ IncreaseAt()

template<int Dimensions>
bool istd::TIndex< Dimensions >::IncreaseAt ( int index)
inline

Increase single component at specified position.

Parameters
indexindex of component should be increased. It must be valid.
Returns
true if success. It is provided for template implementations. In this case it returns always true.

Definition at line 292 of file TIndex.h.

◆ IsDimensionsCountFixed()

template<int Dimensions>
bool istd::TIndex< Dimensions >::IsDimensionsCountFixed ( ) const
inline

Check, if number dimensions is fixed.

It is provided for template implementations. It returns always true.

Definition at line 198 of file TIndex.h.

◆ IsInside()

template<int Dimensions>
bool istd::TIndex< Dimensions >::IsInside ( const TIndex< Dimensions > & boundaries) const

◆ IsSizeEmpty()

template<int Dimensions>
bool istd::TIndex< Dimensions >::IsSizeEmpty ( ) const
inline

Check if this index interpreted as size is empty.

It means, it returns true, is some of components is less or equal 0.

Definition at line 245 of file TIndex.h.

Referenced by imath::TMultidimensionalPolynomial< Dimensions, Element >::ApproximateCoefficientsFromFulcrums(), and istd::TArray< Element, Dimensions >::IsEmpty().

◆ IsValid()

template<int Dimensions>
bool istd::TIndex< Dimensions >::IsValid ( ) const
inline

Check if this index is valid.

Index is valid, if all its components are bigger or equal 0.

Definition at line 219 of file TIndex.h.

◆ IsZero()

template<int Dimensions>
bool istd::TIndex< Dimensions >::IsZero ( ) const
inline

Check if this index point at zero element.

In other words, it checks if all components are 0.

Definition at line 232 of file TIndex.h.

◆ operator!=()

template<int Dimensions>
bool istd::TIndex< Dimensions >::operator!= ( const TIndex< Dimensions > & index) const

Definition at line 360 of file TIndex.h.

◆ operator+()

template<int Dimensions>
TIndex< Dimensions > istd::TIndex< Dimensions >::operator+ ( const TIndex< Dimensions > & index) const

Definition at line 367 of file TIndex.h.

References istd::TIndex< Dimensions >::GetDimensionsCount().

◆ operator+=()

template<int Dimensions>
TIndex< Dimensions > & istd::TIndex< Dimensions >::operator+= ( const TIndex< Dimensions > & index)

Definition at line 382 of file TIndex.h.

References istd::TIndex< Dimensions >::GetDimensionsCount().

◆ operator-()

template<int Dimensions>
TIndex< Dimensions > istd::TIndex< Dimensions >::operator- ( const TIndex< Dimensions > & index) const

Definition at line 395 of file TIndex.h.

References istd::TIndex< Dimensions >::GetDimensionsCount().

◆ operator-=()

template<int Dimensions>
TIndex< Dimensions > & istd::TIndex< Dimensions >::operator-= ( const TIndex< Dimensions > & index)

Definition at line 410 of file TIndex.h.

References istd::TIndex< Dimensions >::GetDimensionsCount().

◆ operator==()

template<int Dimensions>
bool istd::TIndex< Dimensions >::operator== ( const TIndex< Dimensions > & index) const

Definition at line 347 of file TIndex.h.

◆ operator[]() [1/2]

template<int Dimensions>
int & istd::TIndex< Dimensions >::operator[] ( int index)
inline

Definition at line 337 of file TIndex.h.

◆ operator[]() [2/2]

template<int Dimensions>
int istd::TIndex< Dimensions >::operator[] ( int index) const
inline

Definition at line 330 of file TIndex.h.

◆ Reset()

template<int Dimensions>
void istd::TIndex< Dimensions >::Reset ( )
inline

Reset this object.

For this (fixed-size) implementation, it does the same as clear.

See also
Clear()

Definition at line 258 of file TIndex.h.

◆ SetAllTo()

template<int Dimensions>
void istd::TIndex< Dimensions >::SetAllTo ( int value)

Set all components to specified value.

Definition at line 451 of file TIndex.h.

◆ SetAt()

template<int Dimensions>
void istd::TIndex< Dimensions >::SetAt ( int index,
int value )
inline

Set element at specified index.

Definition at line 282 of file TIndex.h.

◆ SetDimensionsCount()

template<int Dimensions>
bool istd::TIndex< Dimensions >::SetDimensionsCount ( int count) const
inline

Set number of dimensions of this index.

It is provided to allows template implementations to use fixed-size or variable arrays.

Parameters
countnumber of dimensions will be set.
Returns
true, if number of set dimensions equals template parameter or false if isn't.

Definition at line 212 of file TIndex.h.


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

© Witold Gantzke and Kirill Lepskiy