A class describing an n-dimensional space at runtime.
More...
#include <DynamicSize.hpp>
List of all members.
Public Member Functions
-
template<int N> DynamicSize (const MultiIndex< N > &MI)
- Initialize from a MultiIndex of certain dimension.
-
template<class T > DynamicSize (int N, const T values[])
- Assign values from arbitrary type that is convertible into integers.
-
DynamicSize (int N)
- Construct a dynamic size of N dimensions, but all extensions set to zero.
-
DynamicSize ()
- Empty default constructor, zero rank.
-
DynamicSize (const DynamicSize &DS)
- Copy constructor.
-
~DynamicSize ()
- Destructor.
-
DynamicSize & operator= (const DynamicSize &DS)
- Assignment.
-
bool operator!= (const DynamicSize &DS)
- Comparison.
-
index_t nElements () const
- How many elements here?
-
int size () const
- Dimensionality of the domain (same as rank).
-
int Rank () const
- Dimensionality of the domain (same as rank).
-
int dimensionality () const
- Dimensionality of the domain (same as rank).
- index_t operator[] (int i) const
- Element access operator.
- const index_t * dims_ptr () const
- Return c pointer to dimension storage.
- bool setSize (int i, index_t what)
- Set the extension of this dimensional size in a certain dimension.
- template<int N> bool get (MultiIndex< N > &MI) const
- Retrieve a dynamic size into a multidimensional index.
Protected Member Functions
Detailed Description
A class describing an n-dimensional space at runtime.
This class complements the MultiIndex<N> template classes which have their dimensionality fixed at compile-time. The DynamicSize class may be used for generic operations on arbitrary, runtime-determined dimensions. However, for high performance usually the compile-time MultiIndex<N> classes should be used. Conversion functions are provided, but must be used with care (check return values!).
Member Function Documentation
const index_t* Fiber::DynamicSize::dims_ptr |
( |
|
) |
const [inline] |
Return c pointer to dimension storage.
Don't use this function. C pointers are evil.
template<int N>
bool Fiber::DynamicSize::get |
( |
MultiIndex< N > & |
MI |
) |
const [inline] |
Retrieve a dynamic size into a multidimensional index.
- Returns:
- false if the dimensions don't match
index_t Fiber::DynamicSize::operator[] |
( |
int |
i |
) |
const [inline] |
Element access operator.
Returns zero if no dimensions have been defined at all, or 1 if the coordinate range is beyond the defined dimensionality.
bool Fiber::DynamicSize::setSize |
( |
int |
i, |
|
|
index_t |
what | |
|
) |
| | [inline] |
Set the extension of this dimensional size in a certain dimension.
- Returns:
- false if anything went wrong, such as illegal dimension specified.