Skip to content

StaticCoords

#include <indexing.hh>
template<int NDim = 1, typename IndexT = ssize_t>
struct StaticCoords

Defined 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.

  • NDIM The dimensionality of the coords object, and by proxy the array itself.

  • IndexT The indexing type. Can, e.g., change the width of the integer.

Name Kind Owner
value variable Declared here
operator[] function Declared here
operator[] function Declared here
size function Declared here
Return Name Description
IndexT value

IndexT value

Defined in src/lib/ncarray/indexing.hh:139

Return Name Description
NCA_HD IndexT & operator[] inline
NCA_HD const IndexT & operator[] const inline

inline

inline NCA_HD IndexT & operator[](int idx)

Defined in src/lib/ncarray/indexing.hh:145


const inline

inline NCA_HD const IndexT & operator[](int idx) const

Defined in src/lib/ncarray/indexing.hh:149

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