|
FiberVISH 0.2
Fish - The Fiber Bundle API for the Vish Visualization Shell
|
A class describing an n-dimensional space at runtime. More...
#include <DynamicSize.hpp>
Public Types | |
| using | rank_t = int |
Public Member Functions | |
| template<Dims_t N> | |
| DynamicSize (const MultiIndex< N > &MI) | |
| Initialize from a MultiIndex of certain dimension. | |
| template<class T > | |
| DynamicSize (Dims_t N, const T values[]) | |
| Assign values from arbitrary type that is convertible into integers. | |
| DynamicSize (Dims_t N, index_t NValue) | |
| Construct a dynamic size of N dimensions, but all extensions set to the given value. | |
| DynamicSize ()=default | |
| Empty default constructor, zero rank. | |
| DynamicSize (const DynamicSize &DS) | |
| Copy constructor. | |
| DynamicSize (index_t SubDimension, const DynamicSize &DS) | |
| Construct a size of one dimension higher. | |
| DynamicSize (int N, const DynamicSize &L, const DynamicSize &R) | |
| Addition constructor. | |
| ~DynamicSize () | |
| Destructor. | |
| DynamicSize & | operator= (const DynamicSize &DS) |
| Assignment. | |
| bool | operator!= (const DynamicSize &DS) const noexcept |
| Unequality Comparison. | |
| bool | operator== (const DynamicSize &DS) const noexcept |
| Equality Comparison. | |
| template<class T > | |
| DynamicSize & | setSize (int N, const T values[]) |
| Assign values from arbitrary type that is convertible into integers. | |
| template<Dims_t N> | |
| DynamicSize & | resize (const MultiIndex< N > &MI) |
| Set a new size from the given MultiIndex. | |
| bool | hasIncompatibleLowerDims (const DynamicSize &DS) const noexcept |
| bool | hasIncompatibleHigherDims (const DynamicSize &DS) const noexcept |
| bool | hasCompatibleHigherDims (const DynamicSize &DS) const noexcept |
| size_t | getElementArraySize (const DynamicSize &DataFragmentDims) const noexcept |
| Given a base space (this), return the number of elements provided by the given data dims, if it is a multidimensional size of just one dimension higher. | |
| bool | hasCompatibleLowerDims (const DynamicSize &DS) const noexcept |
| index_t | nElements () const |
| How many elements here? | |
| index_t | getNumberOfElements () const |
| rank_t | Rank () const |
| Dimensionality of the domain (same as rank). | |
| rank_t | getRank () const |
| Dimensionality of the domain (same as rank). | |
| rank_t | 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 | isValid () const |
| Check if some size has been defined here. | |
| bool | setSize (int i, index_t what) |
| Set the extension of this dimensional size in a certain dimension. | |
| template<Dims_t N> | |
| bool | changeSize (const MultiIndex< N > &MI) |
| Adjust size for lowest matching dimensions. | |
| bool | increment_dims (int incr) |
| Increment each dimensional element by the same value. | |
| bool | multiply_dims (int incr) |
| Multiply each dimensional element by the same factor. | |
| DynamicSize & | increment (const DynamicSize &D) |
| DynamicSize & | operator+= (const DynamicSize &D) |
| bool | setSize (const DynamicSize &D, int FillUp=1) const |
| Set the size from another DynamicSize without changing the rank of this DynamicSize, possible using the FillUp value if the given DynamicSize is smaller than the assigned DynamicSize. | |
| template<typename T > | |
| rank_t | getDims (T *Dims, int MaxEntries) const |
| template<typename T , int N> | |
| rank_t | getDims (T(&Dims)[N]) const |
| template<Dims_t N> | |
| bool | get (MultiIndex< N > &MI) const |
| Retrieve a dynamic size into a multidimensional index. | |
| template<Dims_t N> | |
| MultiIndex< N > | getSize () const |
| Provide the size stored here as a MultiIndex. | |
| std::string | str () const |
| Create textual version of this string. | |
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!).
| Fiber::DynamicSize::DynamicSize | ( | index_t | SubDimension, |
| const DynamicSize & | DS | ||
| ) |
Construct a size of one dimension higher.
The SubDimension will go into indexed dimension zero.
Return c pointer to dimension storage.
Don't use this function. C pointers are evil.
|
inline |
Retrieve a dynamic size into a multidimensional index.
|
inlinenoexcept |
Given a base space (this), return the number of elements provided by the given data dims, if it is a multidimensional size of just one dimension higher.
|
inline |
Provide the size stored here as a MultiIndex.
All MultiIndex components will be zero if the dimension does not match.
Element access operator.
Returns zero if no dimensions have been defined at all, or 1 if the coordinate range is beyond the defined dimensionality.