#include "tensorstore/index_interval.h"
absl::Status tensorstore::ComputeStridedSliceMap(
    
OptionallyImplicitIndexInterval orig,
    
IntervalForm interval_form,
    
Index translate_origin_to,
    
Index start,
    
Index stop_or_size,
    
Index stride,
    
OptionallyImplicitIndexIntervalnew_domain,
    
Indexoutput_offset);

Computes a mapping from the specified interval back to the original domain.

Parameters:
OptionallyImplicitIndexInterval orig

The original domain.

IntervalForm interval_form

Form of the interval.

Index translate_origin_to

If not equal to kImplicit, the resultant *new_domain is translated to the specified origin.

Index start

The index within orig corresponding to the inclusive_min in the resultant value of *new_domain. If equal to kImplicit, the lower (if stride > 0) or upper (if stride < 0) bound of orig is used.

Index stop_or_size

Specifies the inclusive/exclusive stop index or size of the resultant *new_domain.

Index stride

Specifies the stride value.

out
OptionallyImplicitIndexInterval *new_domain

Non-null pointer to result interval set to the new domain computed by ExtractStridedSlice, except that it is translated according to the value of translate_origin_to.

out
Index *output_offset

Non-null pointer set to the value such that *output_offset + stride * i maps each value i in the resultant *new_domain to the corresponding index in orig.

Error absl::StatusCode::kInvalidArgument:

or absl::StatusCode::kOutOfRange if the slice is not valid.