MultiIndex Class Reference

Provides functions for shifting to the 'next' position under the lexicographical and some other oderings and elementar multiindex operations (the abs. value and the factorial). More...

#include <MultiIndex.hpp>

Inheritance diagram for MultiIndex:

Inheritance graph
[legend]
Collaboration diagram for MultiIndex:

Collaboration graph
[legend]
List of all members.

Public Member Functions

MultiIndexoperator= (MultiIndex &src)
 Standard assignment.
MultiIndexoperator= (int v)
 Sets a constant value to all entries.
long abs ()
 The $|.|$-operation.
long factorial ()
 The product of the components.
bool InRange (const Array< int > &range) const
 True if all indices are $\in [0,range_{i}) $.
void Scale (const Array< int > &range, Array< double > &coord) const
 Maps the components linearly onto $[0, 1]$.
bool NextPos (const Array< int > &size)
 Shifts to the next lexicographical position.
bool NextPos (const Array< int > &size, int range)
 Shifts the restricted index to the next lex. pos.
bool NextPos (const Array< int > &size, const SelectedDim &subgrid)
 Shifts to the next lex. pos. in the selected subgrid.
long Offset (long dim, const Array< int > &size) const
 computes the offset of an entry given by first dim entries of the multiindex in a multidim.
long Offset (const Array< int > &size) const
 Computes the offset of an entry given by the multiindex in a multidim.
 MultiIndex ()
 MultiIndex (long dim)
 A multiindex of a given dimension (uninit.).
 MultiIndex (MultiIndex &I)
 Duplication.

Static Public Member Functions

static long SubArrayTotalLen (int n, const Array< int > &size)
 Raw length of subarrays reference by first n indices.

Detailed Description

Provides functions for shifting to the 'next' position under the lexicographical and some other oderings and elementar multiindex operations (the abs. value and the factorial).


Constructor & Destructor Documentation

MultiIndex::MultiIndex (  )  [inline]

MultiIndex::MultiIndex ( long  dim  )  [inline]

A multiindex of a given dimension (uninit.).

MultiIndex::MultiIndex ( MultiIndex I  )  [inline]

Duplication.


Member Function Documentation

MultiIndex& MultiIndex::operator= ( MultiIndex src  )  [inline]

Standard assignment.

MultiIndex& MultiIndex::operator= ( int  v  )  [inline]

Sets a constant value to all entries.

long MultiIndex::abs (  )  [inline]

The $|.|$-operation.

long MultiIndex::factorial (  )  [inline]

The product of the components.

bool MultiIndex::InRange ( const Array< int > &  range  )  const [inline]

True if all indices are $\in [0,range_{i}) $.

Checks the components of the multiindex and returns true if all they are nonnegativ and less then the corresponding components of a given int-array. The latter should have the same or a greater size as the multiindex.

Parameters:
[in] range e.g. sizes of a multidimentional array.

void MultiIndex::Scale ( const Array< int > &  range,
Array< double > &  coord 
) const [inline]

Maps the components linearly onto $[0, 1]$.

The array 'range' contains e.g. the size of a multidimentional array for this multiindex. 'range' may be longer than the multiindex, but the resulting array 'coord' must have the same size

Parameters:
[in] range The range of the components
[out] coord To save the coordinates

bool MultiIndex::NextPos ( const Array< int > &  size  )  [inline]

Shifts to the next lexicographical position.

Parameters:
[in] size The grid size.

bool MultiIndex::NextPos ( const Array< int > &  size,
int  range 
) [inline]

Shifts the restricted index to the next lex. pos.

Parameters:
[in] size The grid size.
[in] range Only the first 'range' indices are considered and changed.

bool MultiIndex::NextPos ( const Array< int > &  size,
const SelectedDim subgrid 
) [inline]

Shifts to the next lex. pos. in the selected subgrid.

Parameters:
[in] size The grid size
[in] subgrid The selected subgrid

long MultiIndex::Offset ( long  dim,
const Array< int > &  size 
) const [inline]

computes the offset of an entry given by first dim entries of the multiindex in a multidim.

Parameters:
[in] dim First dim entries.
[in] size Array with sizes.
Returns:
Offset of the corresponding element
Note:
This function checks the indexation range.

'dim' should be POSITIVE and less than or equal to index.Length() and size.Length()

long MultiIndex::Offset ( const Array< int > &  size  )  const [inline]

Computes the offset of an entry given by the multiindex in a multidim.

Parameters:
[in] size Array with sizes.
Returns:
Offset of the corresponding element

static long MultiIndex::SubArrayTotalLen ( int  n,
const Array< int > &  size 
) [inline, static]

Raw length of subarrays reference by first n indices.

Computes the raw length (i.e. the number of objects) of subarrays indexed by multiindices of the length n. 'n' should be less or equal the dimensionality of the array; if this condition is not satisfied and the index range checking is on, the function throws the fatal error exception.

Parameters:
[in] n Number of the first indices
[in] size The size of the array


The documentation for this class was generated from the following file:
Generated on Fri Sep 21 12:34:21 2007 for SG2 by  doxygen 1.5.2