-
#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,
OptionallyImplicitIndexInterval* new_domain,
Index* output_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 theinclusive_min
in the resultant value of*new_domain
. If equal tokImplicit
, the lower (ifstride > 0
) or upper (ifstride < 0
) bound oforig
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 oftranslate_origin_to
.- out
- Index *output_offset¶
Non-null pointer set to the value such that
*output_offset + stride * i
maps each valuei
in the resultant*new_domain
to the corresponding index inorig
.
- Error absl::StatusCode::kInvalidArgument:¶
or
absl::StatusCode::kOutOfRange
if the slice is not valid.