WaveBlocksND
|
The \( s \)-th slice of a shape enumeration contains all multi-indices \( \boldsymbol{k} \in \mathfrak{K} \) that satisfy \( \displaystyle\sum_{d=1}^{D} k_d = s \). More...
#include <shape_enum.hpp>
Public Types | |
typedef std::vector< MultiIndex >::const_iterator | const_iterator |
Public Member Functions | |
ShapeSlice ()=default | |
ShapeSlice (const ShapeSlice &that)=default | |
ShapeSlice (ShapeSlice &&that) | |
ShapeSlice & | operator= (const ShapeSlice &that)=default |
ShapeSlice & | operator= (ShapeSlice &&that) |
ShapeSlice (std::size_t offset) | |
ShapeSlice (std::vector< MultiIndex > &&table, std::size_t offset) | |
std::vector< MultiIndex > & | _table () |
std::vector< MultiIndex > const & | _table () const |
std::size_t | offset () const |
Retrieves the number of nodes in all previous slices. More... | |
std::size_t | size () const |
const_iterator | begin () const |
Returns a const-iterator pointing to the first node. More... | |
const_iterator | end () const |
Returns a const-iterator referring to the past-the-end node. More... | |
const_iterator | cbegin () const |
Returns a const-iterator pointing to the first node. More... | |
const_iterator | cend () const |
Returns a const-iterator referring to the past-the-end node. More... | |
MultiIndex | operator[] (std::size_t ordinal) const |
Returns the multi-index of the node at position ordinal. More... | |
bool | try_find (const MultiIndex &index, std::size_t &ordinal) const |
Retrieves the position of the node \( k \), if \( k \) is part of this slice. More... | |
std::size_t | find (const MultiIndex &index) const |
Returns the position of a node. More... | |
std::array< std::size_t, D > | find_backward_neighbours (const MultiIndex &_index) const |
Retrieves the ordinals of all backward neighbours \( \{k-e^1, \ldots, k-e^D\} \) of a lattice node \(k \). More... | |
bool | operator== (const ShapeSlice &that) const |
Checks whether both sides are equals by comparison of every node. More... | |
bool | operator!= (const ShapeSlice &that) const |
Private Member Functions | |
MultiIndex | forward_ (MultiIndex index, dim_t axis) const |
MultiIndex | backward_ (MultiIndex index, dim_t axis) const |
Private Attributes | |
std::size_t | offset_ |
std::vector< MultiIndex > | table_ |
The \( s \)-th slice of a shape enumeration contains all multi-indices \( \boldsymbol{k} \in \mathfrak{K} \) that satisfy \( \displaystyle\sum_{d=1}^{D} k_d = s \).
typedef std::vector<MultiIndex>::const_iterator waveblocks::wavepackets::shapes::ShapeSlice< D, MultiIndex >::const_iterator |
|
default |
|
default |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlineprivate |
|
inline |
Returns a const-iterator pointing to the first node.
|
inline |
Returns a const-iterator pointing to the first node.
|
inline |
Returns a const-iterator referring to the past-the-end node.
|
inline |
Returns a const-iterator referring to the past-the-end node.
|
inline |
Returns the position of a node.
Notice that the first node in the slice has position 0 (not 1 or offset()).
Portable programs should never call this function with an node that is not part of this slice, since this causes undefined behaviour.
Caution: You have to add the slice-offset to the position to get the ordinal of the node.
Complexity: Logarithmic in the number of slice-nodes.
[in] | index | The |
|
inline |
Retrieves the ordinals of all backward neighbours \( \{k-e^1, \ldots, k-e^D\} \) of a lattice node \(k \).
Notice that the first node in the slice has ordinal 0 (not 1 or offset()).
Important: This function only works if \( k \in \mathfrak{K} \), otherwise behaviour is undefined!
Don't forget that you have to consult the correct slice. If \( k \) is part of the \( s \)-th slice. you have to call the member function of the \( (s-1) \)-th slice.
_index | The multi-index \( k \). |
|
inlineprivate |
|
inline |
Retrieves the number of nodes in all previous slices.
Aside, the offset is the ordinal of the first node in this slice.
|
inline |
|
default |
|
inline |
|
inline |
Checks whether both sides are equals by comparison of every node.
|
inline |
Returns the multi-index of the node at position ordinal.
Notice that the first node in the slice has position 0 (not 1 or offset()).
Portable programs should never call this function with an argument that is out-of-range, since this causes undefined behaviour.
Complexity: logarithmic in the number of slice-nodes
[in] | ordinal | position of a node in this slice |
|
inline |
|
inline |
Retrieves the position of the node \( k \), if \( k \) is part of this slice.
The first node in the slice has position 0 (not 1 or offset()).
Caution: You have to add the slice-offset to the position to get the ordinal of the node.
Complexity: Logarithmic in the number of slice-nodes.
[in] | index | The node \( k \). |
[out] | ordinal | Reference to |
|
private |
|
private |