StaticCoords
StaticCoords
Section titled “StaticCoords”#include <indexing.hh>template<int NDim = 1, typename IndexT = ssize_t>struct StaticCoordsDefined in src/lib/ncarray/indexing.hh:138
A small struct with compile-time constant size for indexing arrays.
The constexpr size makes it far easier for the compiler to unroll loops and optimize certain hot paths.
Parameters
Section titled “Parameters”-
NDIMThe dimensionality of the coords object, and by proxy the array itself. -
IndexTThe indexing type. Can, e.g., change the width of the integer.
List of all members
Section titled “List of all members”| Name | Kind | Owner |
|---|---|---|
value |
variable |
Declared here |
operator[] |
function |
Declared here |
operator[] |
function |
Declared here |
size |
function |
Declared here |
Public Attributes
Section titled “Public Attributes”| Return | Name | Description |
|---|---|---|
IndexT |
value |
IndexT valueDefined in src/lib/ncarray/indexing.hh:139
Public Methods
Section titled “Public Methods”| Return | Name | Description |
|---|---|---|
NCA_HD IndexT & |
operator[] inline |
|
NCA_HD const IndexT & |
operator[] const inline |
operator[]
Section titled “operator[]”inline
inline NCA_HD IndexT & operator[](int idx)Defined in src/lib/ncarray/indexing.hh:145
operator[]
Section titled “operator[]”const inline
inline NCA_HD const IndexT & operator[](int idx) constDefined in src/lib/ncarray/indexing.hh:149
Public Static Methods
Section titled “Public Static Methods”| Return | Name | Description |
|---|---|---|
NCA_HD constexpr int |
size static inline constexpr |
static inline constexpr
constexpr static inline NCA_HD constexpr int size()Defined in src/lib/ncarray/indexing.hh:141