|
template<int SIZE, typename T > |
constexpr std::enable_if_t<(SIZE==1), T > | multiplyAll (T const *const LVARRAY_RESTRICT values) |
|
template<int SIZE, typename T > |
constexpr std::enable_if_t<(SIZE > 1), T > | multiplyAll (T const *const LVARRAY_RESTRICT values) |
|
template<int USD, typename INDEX_TYPE , typename INDEX > |
constexpr INDEX_TYPE | getLinearIndex (INDEX_TYPE const *const LVARRAY_RESTRICT strides, INDEX const index) |
| Get the index into a one dimensional space. More...
|
|
template<int USD, typename INDEX_TYPE , typename INDEX , typename ... REMAINING_INDICES> |
constexpr INDEX_TYPE | getLinearIndex (INDEX_TYPE const *const LVARRAY_RESTRICT strides, INDEX const index, REMAINING_INDICES const ... indices) |
| Get the index into a a multidimensional space. More...
|
|
std::string | getIndexString () |
|
template<typename INDEX , typename ... REMAINING_INDICES> |
std::string | getIndexString (INDEX const index, REMAINING_INDICES const ... indices) |
|
template<typename INDEX_TYPE , typename ... INDICES> |
std::string | printDimsAndIndices (INDEX_TYPE const *const LVARRAY_RESTRICT dims, INDICES const ... indices) |
|
template<typename INDEX_TYPE , typename ... INDICES> |
constexpr bool | invalidIndices (INDEX_TYPE const *const LVARRAY_RESTRICT dims, INDICES const ... indices) |
|
template<typename INDEX_TYPE , typename ... INDICES> |
void | checkIndices (INDEX_TYPE const *const LVARRAY_RESTRICT dims, INDICES const ... indices) |
| Check that the indices are with dims , if not the program is aborted. More...
|
|
Contains functions to aid in multidimensional indexing.
template<int USD, typename INDEX_TYPE , typename INDEX , typename ... REMAINING_INDICES>
constexpr INDEX_TYPE LvArray::indexing::getLinearIndex |
( |
INDEX_TYPE const *const LVARRAY_RESTRICT |
strides, |
|
|
INDEX const |
index, |
|
|
REMAINING_INDICES const ... |
indices |
|
) |
| |
|
inline |
Get the index into a a multidimensional space.
- Template Parameters
-
USD | The unit stride dimension of strides. |
INDEX_TYPE | The integral type of the strides and the type to return. |
INDEX | The integral type of the first index. |
REMAINING_INDICES | A variadic pack of the integral types of the remaining indices. |
- Parameters
-
strides | A pointer to the strides of the dimension. |
index | The index into the first dimension. |
indices | A variadic pack of the indices to the remaining dimensions. |
- Note
- If 0 <= USD < the number of dimensions then strides[ USD ] is assumed to equal 1.
- Returns
- The dot product of
strides
with ( index
, indices
... ).
Definition at line 123 of file indexing.hpp.