Namespace to handle the conversion between one dimensional and three dimensional indices.
More...
|
template<typename T > |
constexpr T | threeToOneD (T x, T y, T z, const std::array< T, 3 > &dims) |
| Convert a 3d index to a 1d index.
|
|
template<typename T > |
constexpr T | threeToOneD (const std::array< T, 3 > &index3d, const std::array< T, 3 > &dims) |
| Convert a 3d index to a 1d index.
|
|
template<typename T > |
constexpr std::array< T, 3 > | oneToThreeD (T ind, const std::array< T, 3 > &dims) |
| Convert a 1d index to a 3d index.
|
|
Namespace to handle the conversion between one dimensional and three dimensional indices.
The running index is x.
◆ oneToThreeD()
template<typename T >
constexpr std::array< T, 3 > autopas::utils::ThreeDimensionalMapping::oneToThreeD |
( |
T |
ind, |
|
|
const std::array< T, 3 > & |
dims |
|
) |
| |
|
constexpr |
Convert a 1d index to a 3d index.
- Template Parameters
-
- Parameters
-
ind | The 1d index. |
dims | The total dimensions of the index space. |
- Returns
- The 3d index.
◆ threeToOneD() [1/2]
template<typename T >
constexpr T autopas::utils::ThreeDimensionalMapping::threeToOneD |
( |
const std::array< T, 3 > & |
index3d, |
|
|
const std::array< T, 3 > & |
dims |
|
) |
| |
|
constexpr |
Convert a 3d index to a 1d index.
- Template Parameters
-
- Parameters
-
index3d | The 3d index. |
dims | The total dimensions of the index space. |
- Returns
- The 1d index.
◆ threeToOneD() [2/2]
template<typename T >
constexpr T autopas::utils::ThreeDimensionalMapping::threeToOneD |
( |
T |
x, |
|
|
T |
y, |
|
|
T |
z, |
|
|
const std::array< T, 3 > & |
dims |
|
) |
| |
|
constexpr |
Convert a 3d index to a 1d index.
- Template Parameters
-
- Parameters
-
x | x index of the 3d index. |
y | y index of the 3d index. |
z | z index of the 3d index. |
dims | The total dimensions of the index space. |
- Returns
- The 1d index.