-
#include "tensorstore/index_space/dim_expression.h" -
template <typename Strides>
auto tensorstore::DimExpression<Op...>::Stride(
const Strides& strides) const; Strides the domains of the selected input dimensions by the specified
stridesvector.For each selected dimension
i, the new domain is the set of indicesxsuch thatx * strides[i]is contained in the original domain.This has the same effect as
SizedInterval(kImplicit, kImplicit, strides)except that the domain may be translated by 1 and does not require a bounded start index.The new dimension selection is the same as the prior dimension selection, with a static rank equal to the merged static rank of the prior dimension selection and the static extent of the
stridesvector.For example:
Dims(0, 2).Stride({-2, 3})has the following effects:Before
After
Dimension selection
{0, 2}{0, 2}Input domain
[0, 6], [2, 5], [1, 8][-3, 0], [2, 5], [1, 2]Labels
{"x", "y", "z"}{"x", "y", "z"}Equivalent input indices
{4, 3, 3}{-2, 3, 1}Equivalent input indices
{-2 * x, y, 3 * z}{x, y, z}where
xis any index in[-3, 0],yis any index in[2, 5], andzis any index in[1, 2].- Requires:¶
Stridessatisfies the IsIndexVectorOrScalar concept with a static extent compatible with the static rank of the dimension selection.- Parameters:¶
- Error absl::StatusCode::kInvalidArgument:¶
if the extent of the
stridesvector is not equal to the number of selected dimensions.- Error absl::StatusCode::kInvalidArgument:¶
if a stride value is
0.