-
#include "tensorstore/index_space/index_transform_builder.h" -
IndexTransformBuilder& tensorstore::
IndexTransformBuilder<InputRank, OutputRank>::output_index_array(
DimensionIndex output_dim,
Index offset,
Index stride,
const SharedArrayView<const Index,
dynamic_rank,
offset_origin>& index_array,
Result<IndexInterval> index_range = IndexInterval()); Sets the output index map for output dimension
output_dimto anOutputIndexMethod::arraymap with the specifiedoffset,stride,index_array, and optionalindex_range.Specifically, specifies the mapping:
output[output_dim] = offset + stride * bounded(index_array(input - input_origin), index_range)where
bounded(index, index_interval)is equivalent toindexifindexis contained inindex_interval.FiniteSubset(), and results in an error otherwise.- Parameters:¶
- DimensionIndex output_dim¶
The output dimension for which to set the output index map.
- Index offset¶
The offset value.
- Index stride¶
The stride value by which to multiply the values in
index_array.- const SharedArrayView<const Index, dynamic_rank, offset_origin> &index_array¶
The index array (may have an origin kind of
zero_originoroffset_origin). Ifindex_array.shape()is not broadcast-compatible with theinput_shape, this output index map is considered invalid (resulting inFinalizereturning an error). The origin ofindex_arrayis ignored; instead, it is translated to have an origin equal to theinput_originof the index transform.- Result<IndexInterval> index_range = IndexInterval()¶
The bounds on the values in
index_array. These are checked lazily when the transform is used. If an error result is specified, this output index map is considered invalid (resulting inFinalizereturning an error).
- Pre:¶
valid() == true
Note
This method overrides any output index map for
output_dimspecified by a previousoutput_*(output_dim, ...)call.