#include "tensorstore/index_space/dim_expression.h"
template <typename Strides>
auto tensorstore::DimExpression<Op...>::Stride(
    
const Stridesstrides) const;

Strides the domains of the selected input dimensions by the specified strides vector.

For each selected dimension i, the new domain is the set of indices x such that x * 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 strides vector.

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 x is any index in [-3, 0], y is any index in [2, 5], and z is any index in [1, 2].

Requires:

Strides satisfies the IsIndexVectorOrScalar concept with a static extent compatible with the static rank of the dimension selection.

Parameters:
const Strides &strides

Index vector specifying the stride for each selected dimension. May be a braced list, e.g. Stride({1, 2, 3}). May also be a scalar, e.g. Stride(5), in which case the same stride is used for all selected dimensions.

Error absl::StatusCode::kInvalidArgument:

if the extent of the strides vector is not equal to the number of selected dimensions.

Error absl::StatusCode::kInvalidArgument:

if a stride value is 0.