-
#include "tensorstore/index_space/dim_expression.h"
-
auto tensorstore::DimRange(
DimensionIndex inclusive_start,
std::optional<DimensionIndex> exclusive_stop = std::nullopt,
const DimensionIndex step = 1); Starts a
DimExpression
with a range of dimensions.See
DimRangeSpec
for more detailed documentation.DimRange(3)
specifies all dimensions greater than 3.DimRange(3, 6)
specifies dimensions {3, 4, 5}.DimRange(3, std::nullopt, 2)
specifies odd dimensions greater than 3.DimRange(-3)
specifies the last 3 dimensions, and can be used to add 3 new trailing dimensions.DimRange(1, -2)
specifies dimensions 1 up to but not including the second from the last. It cannot be used to infer the final rank when adding new dimensions.
Since
DimRange
resolves to a variable number of dimensions, the resultingDimExpression
always has a compile-time rank ofdynamic_rank
.