34template <MemoryOrder memory_order>
36 assert((a >= 0) && (a < adim[0]));
37 assert((b >= 0) && (b < adim[1]));
38 assert((c >= 0) && (c < adim[2]));
40 return a + adim[0] * (b + adim[1] * c);
42 return adim[1] * adim[2] * a + adim[2] * b + c;
57 return get_linear_index<MemoryOrder::COLUMN_MAJOR>(a, b, c, adim);
59 return get_linear_index<MemoryOrder::ROW_MAJOR>(a, b, c, adim);
68template <MemoryOrder memory_order>
70 return get_linear_index<memory_order>(ind[0], ind[1], ind[2], adim);
87 assert(j >= 0 and j <= i);
88 return (i * (i + 1)) / 2 + j;
Vector implementation and trait types for boost qvm interoperability.
T lower_triangular(T i, T j)
Linear index into a lower triangular matrix.
int get_linear_index(int a, int b, int c, const Vector3i &adim)