#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_dim to an OutputIndexMethod::array map with the specified offset, stride, index_array, and optional index_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 to index if index is contained in index_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_origin or offset_origin). If index_array.shape() is not broadcast-compatible with the input_shape, this output index map is considered invalid (resulting in Finalize returning an error). The origin of index_array is ignored; instead, it is translated to have an origin equal to the input_origin of 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 in Finalize returning an error).

Pre:

valid() == true

Note

This method overrides any output index map for output_dim specified by a previous output_*(output_dim, ...) call.