-
#include "tensorstore/index_space/index_domain.h"
-
template <DimensionIndex SubRank = dynamic_rank>
IndexDomain<SubRank, container>
tensorstore::IndexDomain<Rank, CKind>::operator[](
span<const DimensionIndex, SubRank> dims) const; -
template <DimensionIndex SubRank>
IndexDomain<SubRank, container>
tensorstore::IndexDomain<Rank, CKind>::operator[](
const DimensionIndex (&dims)[SubRank]) const; Returns a new domain in which dimension
i
is equal to dimensiondims[i]
of this domain.Example
Given an
IndexDomain
orig
with dimensions:"x": [2, 7), "y": [3, 10), "z": [4, 8)
, the result oforig[{2, 0}]
is anIndexDomain
with dimensions:"z": [4, 8), "x": [2, 7)
.- Parameters:¶
- span<const DimensionIndex, SubRank> dims¶
- const DimensionIndex (&dims)[SubRank]
Sequence of dimensions to include in the new domain. All dimensions in
dims
must be unique. May be specified as a braced list, e.g.domain[{2, 3, 0}]
.
- Pre:¶
valid()
- Dchecks:¶
dims[i] >= 0 && dims[i] < rank()
for0 <= i < dims.size()
.