10namespace stratax::indexing {
27template<
typename IndexContainer>
30 const IndexContainer& indices)
32 std::size_t result = 0;
34 auto stride_it = strides.
begin();
36 for (
const auto index : indices)
38 result += index * *stride_it;
std::size_t offset(const core::Shape &strides, const IndexContainer &indices)
Computes an unchecked flat offset from strides and normalized indices.
Immutable dimension metadata and checked row-major strides.
Stores the dimensions of a multidimensional array.
const_iterator begin() const noexcept
Returns a const iterator to the first dimension.