|
FiberVISH 0.2
Fish - The Fiber Bundle API for the Vish Visualization Shell
|
A recursively defined multidimensional index. More...
#include <MultiIndex.hpp>
Public Types | |
| enum | { dims = Dims , SIZE = Dims } |
| typedef index_t | value_type |
Public Member Functions | |
| constexpr | MultiIndex (const MultiIndex &M, const MultiIndex &D, const Add &) noexcept |
| Computational constructor for adding two multidimensional indices. | |
| constexpr | MultiIndex (const MultiIndex &M, const MultiIndex &D, const Sub &) noexcept |
| Computational constructor for subtracting two multidimensional indices. | |
| constexpr | MultiIndex (const MultiIndex &M, const MultiIndex &D, const Mult &) noexcept |
| Computational constructor for component-wise multiplication of two multidimensional indices. | |
| constexpr | MultiIndex (const MultiIndex &M, const MultiIndex &D, const Div &) |
| Computational constructor for component-wise division of two multidimensional indices. | |
| constexpr | MultiIndex (unsigned int bits, const ::Eagle::BinaryAnd &) noexcept |
| constexpr | MultiIndex (const MultiIndex &M, const MultiIndex &D, const ::Eagle::BinaryAnd &) noexcept |
| constexpr | MultiIndex (const MultiIndex &M, const Power2Alignment &) noexcept |
| constexpr | MultiIndex (const std::array< index_t, Dims > &A) |
| Construct from std::array of same size. | |
| constexpr | MultiIndex (const std::initializer_list< index_t > &A) |
| Construct from set of indices. | |
| MultiIndexIterator< Dims > | begin () const |
| Begin a ranged loop. | |
| MultiIndexIterator< Dims > | end () const |
| End a ranged loop. | |
| index_t | BitIndex () const |
| From this given multiindex which is supposed to have index values of either 0 or 1 in each direction, return the corresponding binary pattern that creates this multiindex. | |
| index_t | Orientation () const noexcept |
| Given a MultiIndex that only contains one element of value 1, all others being zero (such as one created by the Axis() function), return the orientation that creates this. | |
| constexpr int | getSignedOrientation (const MultiIndex &B) const |
| Returns the dimension, starting with 1, in which this multidimensional index is non-zero. | |
| constexpr | MultiIndex () noexcept |
| Default constructor (initialization by zero) | |
| constexpr | MultiIndex (const index_t &I) noexcept |
| Initialize all indices with same value. | |
| constexpr | MultiIndex (const MultiIndex< Dims-1 > &Midx, const index_t &I) noexcept |
| Multidimensional index as tensor product of subdimension and index. | |
| constexpr | MultiIndex (const MultiIndex< Dims-1 > &m, const index_t &Slice, int SliceDirection) |
| Multidimensional index as product of subdimension and index for a given slice dimension (create global index from hyperslab index) | |
| constexpr | MultiIndex (const index_t &lin_idx, const MultiIndex &Dimens, const CreateFromLinear &) |
| Create multidimensional index from one-dimensional index, given the multidimensional dimension on where this index shall count through. | |
| constexpr const MultiIndex< Dims-1 > & | subidx () const noexcept |
| Return associated constant dimensionator of one dimension less. | |
| constexpr MultiIndex< Dims-1 > & | subidx () noexcept |
| Return associated dimensionator of one dimension less. | |
| constexpr const index_t & | operator[] (std::size_t i) const |
| Indexing operator to access values for each dimension. | |
| constexpr index_t & | operator[] (std::size_t i) noexcept |
| Indexing operator to access values for each dimension. | |
| Eagle::Assignment< MultiIndex, 0 > | operator= (const index_t &i) |
| Assignment via comma operator. | |
| constexpr const index_t & | maxidx () const noexcept |
| constexpr index_t & | maxidx () noexcept |
| index_t | size () const noexcept |
| Recursive function to compute the entire number of elements. | |
| constexpr bool | operator!= (const MultiIndex &D) const noexcept |
| inequality comparision operator | |
| constexpr bool | operator== (const MultiIndex &M) const noexcept |
| comparison operator | |
| MultiIndex & | operator+= (const MultiIndex &D) noexcept |
| component-wise self-addition | |
| MultiIndex & | operator-= (const MultiIndex &D) noexcept |
| component-wise self-subtraction | |
| bool | inc (const MultiIndex &Dimens) noexcept |
| Increment the current index, if it is larger than the extent a given in the Dimensions parameter, the certain index is reset to zero in this dimension and the next dimension is increased. | |
| bool | inc (const MultiIndex &Dimens, const MultiIndex &Increment) noexcept |
| Increment the current index by a certain increment. | |
| index_t | linear (const MultiIndex &Dimens) const |
| Compute the linear index from the given dimensionator. | |
| bool | isWithin (const MultiIndex &Range) const noexcept |
| Check whether this multidimensional index is within the specified domain. | |
| bool | operator< (const MultiIndex &Range) const noexcept |
| Check if the current multiindex is smaller than the range. | |
| bool | operator> (const MultiIndex &Range) const noexcept |
| Check if the current multiindex is larger than the range. | |
| MultiIndex | operator+ (const MultiIndex &D) const noexcept |
| Add two multidimensional indices. | |
| MultiIndex | operator- (const MultiIndex &D) const noexcept |
| Subtract multidimensional indices. | |
| MultiIndex | operator* (const MultiIndex &D) const noexcept |
| Multiply multidimensional indices component-wise. | |
| MultiIndex | operator/ (const MultiIndex &D) const noexcept |
| Divide multidimensional indices component-wise. | |
| MultiIndex | operator& (int i) const |
| Shortcut operator to compute the MultiIndex that is just one step aside in the direction as specified by the integer. | |
Static Public Member Functions | |
| static MultiIndex | BitIndex (unsigned int bits) noexcept |
| Multidimensional bit indices, that are zero or one in each of the directions as specified by the bits. | |
| static MultiIndex | Axis (unsigned int orientation) noexcept |
| Return a MultiIndex that points just in the given orientation. | |
| static int | log2 (index_t N) noexcept |
| Logarithm of basis 2 where we expect a maximum value of 1<<(Dims-1) here. | |
| template<class Functor > | |
| static bool | ForEach (Functor &F, const MultiIndex &Start, const MultiIndex &End, const MultiIndex &Increment=MultiIndex(1)) |
Static Protected Member Functions | |
| template<class Functor , Dims_t SuperDims> | |
| static bool | ForEachRecursion (Functor &F, const MultiIndex< SuperDims > &SuperIndex, const MultiIndex &Start, const MultiIndex &End, const MultiIndex &Increment) |
Friends | |
| MultiIndex | distance (const MultiIndex &M0, const MultiIndex &M1) |
| Compute the distance between two multiindices, which is always positive in each index (in contrast to the subtraction operation). | |
| MultiIndex | bitalign (const MultiIndex &M) noexcept |
| MultiIndex | operator| (const MultiIndex &M, int i) |
| Axis index subtraction operator, similar to adding an integer to a multidimensional index, but opposite direction. | |
Related Symbols | |
(Note that these are not member symbols.) | |
| template<Dims_t Dims> | |
| constexpr FixedArray< double, Dims > | div (const MultiIndex< Dims > &Divisor, const MultiIndex< Dims > &Dividend) |
| Compute the rational division of two MultiIndex es. | |
| template<class VectorType , class Domain , class scalar_t > | |
| Eagle::DomainVector< VectorType, Domain, scalar_t > | CellSize (const Eagle::DomainVector< VectorType, Domain, scalar_t > &V, const MultiIndex< VectorType::SIZE > &Dividend, const MultiIndex< VectorType::SIZE > &Stride=MultiIndex< VectorType::SIZE >(1)) |
| Compute the size of a "cell" given a distance between a set of points. | |
| template<class VectorType , class Domain , class scalar_t > | |
| Eagle::DomainVector< VectorType, Domain, scalar_t > | CellSize0 (const Eagle::DomainVector< VectorType, Domain, scalar_t > &V, const MultiIndex< VectorType::SIZE > &Dividend, const MultiIndex< VectorType::SIZE > &Stride=MultiIndex< VectorType::SIZE >(1)) |
| Compute the size of a "cell" given a distance between a set of points. | |
| template<Dims_t Dims> | |
| MultiIndex< Dims > | operator+ (index_t C, const MultiIndex< Dims > &I) |
| Add constant plus multi-index. | |
| template<Dims_t Dims> | |
| MultiIndex< Dims > | operator+ (const MultiIndex< Dims > &I, index_t C) |
| Add multi-index plus constant. | |
| template<Dims_t Dims> | |
| FixedArray< double, Dims > | operator* (const FixedArray< double, Dims > &a, const MultiIndex< Dims > &I) |
| Component-wise multiplication. | |
| template<Dims_t Dims> | |
| FixedArray< double, Dims > | operator* (const MultiIndex< Dims > &I, const FixedArray< double, Dims > &a) |
| Component-wise multiplication. | |
| template<Dims_t Dims> | |
| FixedArray< double, Dims > | operator/ (const FixedArray< double, Dims > &a, const MultiIndex< Dims > &I) |
| Component-wise division. | |
| template<Dims_t Dims> | |
| FixedArray< double, Dims > & | operator/= (FixedArray< double, Dims > &a, const MultiIndex< Dims > &I) |
| Component-wise division. | |
| template<Dims_t Dims> | |
| FixedArray< double, Dims > & | operator*= (FixedArray< double, Dims > &a, const MultiIndex< Dims > &I) |
| Component-wise multiplication. | |
| template<Dims_t Dims> | |
| FixedArray< int, Dims > | MultiIndexToFixedArray (const MultiIndex< Dims > &Value) |
| template<Dims_t Dims> | |
| MultiIndex< Dims > | FixedArrayToMultiIndex (const FixedArray< int, Dims > &Value) |
| template<Dims_t Dims> | |
| MultiIndex< Dims > | minMultiIndex (const MultiIndex< Dims > &A, const MultiIndex< Dims > &B) |
| template<Dims_t Dims> | |
| MultiIndex< Dims > | maxMultiIndex (const MultiIndex< Dims > &A, const MultiIndex< Dims > &B) |
A recursively defined multidimensional index.
A multidimensional index that is automatically a lower-dimensional index via recursion.
The base class corresponds to the lowest dimension, each new child class adds a new dimension.
A MultiIndex ("multidimensional Index") can be: A Type Product between two Indices An Index with Dimensionator
|
inlineconstexpr |
Construct from set of indices.
|
inlineconstexpr |
Multidimensional index as product of subdimension and index for a given slice dimension (create global index from hyperslab index)
|
inlineconstexpr |
Create multidimensional index from one-dimensional index, given the multidimensional dimension on where this index shall count through.
This is the inverse operation to the linear() member function.
Test code:
|
inlinestaticnoexcept |
Return a MultiIndex that points just in the given orientation.
It is given by
with orientation < Dims . The inverse operation is the Orientation() member function.
References Fiber::MultiIndex< Dims >::BitIndex().
Referenced by Fiber::RegularTopology::ComputeEdgeIDfromVertexAndOrientation(), Fiber::RegularTopology::ComputeFirstEdgeVertex(), Fiber::RegularTopology::EdgeOrientation(), Fiber::MultiIndex< Dims >::operator&(), and Fiber::PartialDerivative().
|
inline |
From this given multiindex which is supposed to have index values of either 0 or 1 in each direction, return the corresponding binary pattern that creates this multiindex.
References Fiber::MultiIndex< Dims >::linear(), and Fiber::MultiIndex< Dims >::MultiIndex().
Referenced by Fiber::MultiIndex< Dims >::Axis(), Fiber::RegularTopology::ComputeSecondEdgeVertex(), Fiber::RegularTopology::NumberOfEdges(), Fiber::MultiIndex< Dims >::Orientation(), and Fiber::Polygonize().
|
inlinestaticnoexcept |
Multidimensional bit indices, that are zero or one in each of the directions as specified by the bits.
They can be used to compute the corners of an n-dimensional hypercube or the direction of the n-th axis.
References Fiber::MultiIndex< Dims >::MultiIndex().
|
inlineconstexpr |
Returns the dimension, starting with 1, in which this multidimensional index is non-zero.
The result will be negative if the specified index is smaller than the current one, and zero, if both indices are identical. If there is more than one non-zero index, then it will return the highest dimension where an index difference is found.
References Fiber::MultiIndex< Dims >::subidx().
|
inlinenoexcept |
Increment the current index by a certain increment.
If it is larger than the extent a given in the Dimensions parameter, the certain index is reset to zero in this dimension and the next dimension is increased.
References Fiber::MultiIndex< Dims >::inc(), and Fiber::MultiIndex< Dims >::subidx().
|
inline |
Compute the linear index from the given dimensionator.
Referenced by Fiber::MultiIndex< Dims >::BitIndex().
|
inline |
Shortcut operator to compute the MultiIndex that is just one step aside in the direction as specified by the integer.
Adding 0 yields the original vector, adding +1 moves one element forward in the first axis, adding -1 moves one element backward along the first axis, etc. . The idea stems from Massimo Pierro's FermiQCD package.
References Fiber::MultiIndex< Dims >::Axis().
|
inlineconstexpr |
Indexing operator to access values for each dimension.
The current class member's index corresponds to the highest dimension, the base class to the lowest dimension.
References Fiber::MultiIndex< Dims >::subidx().
|
inlinenoexcept |
Given a MultiIndex that only contains one element of value 1, all others being zero (such as one created by the Axis() function), return the orientation that creates this.
References Fiber::MultiIndex< Dims >::BitIndex(), and Fiber::MultiIndex< Dims >::log2().