-
#include "tensorstore/index_space/index_transform.h"
-
absl::Status tensorstore::PropagateInputDomainResizeToOutput(
IndexTransformView<> transform,
span<const Index> requested_input_inclusive_min,
span<const Index> requested_input_exclusive_max,
bool can_resize_tied_bounds,
span<Index> output_inclusive_min_constraint,
span<Index> output_exclusive_max_constraint,
span<Index> new_output_inclusive_min,
span<Index> new_output_exclusive_max,
bool* is_noop); Propagates a resize request on the input domain to the output space.
- Parameters:¶
- IndexTransformView<> transform¶
The index transform.
- span<const Index> requested_input_inclusive_min¶
Requested new inclusive min bounds on the input domain. A bound of
kImplicit
indicates no change.- span<const Index> requested_input_exclusive_max¶
Requested new exclusive max bounds on the input domain. A bound of
kImplicit
indicates no change.- bool can_resize_tied_bounds¶
If
true
, fails if the resize would potentially affect any positions not within the output range oftransform
.- out
- span<Index> output_inclusive_min_constraint¶
Set to constraints on the inclusive_min bounds of the output space that must be satisfied in order for the resize to not affect positions outside the output range of
transform
. Each value not equal tokImplicit
must match the corresponding existingIndexInterval::inclusive_min
bound. Ifcan_resize_tied_bounds == true
, all values are set equalkImplicit
.- out
- span<Index> output_exclusive_max_constraint¶
Set to constraints on the exclusive_max bounds of the output space that must be satisfied in order for the resize to not affect positions outside the output range of
transform
. Each value not equal tokImplicit
must match the corresponding existingIndexInterval::exclusive_min
bound. Ifcan_resize_tied_bounds == true
, all values are set equalkImplicit
.- out
- span<Index> new_output_inclusive_min¶
Set to the new
IndexInterval::inclusive_min
bounds for the output space. A bound ofkImplicit
indicates no change.- out
- span<Index> new_output_inclusive_min¶
Set to the new
IndexInterval::exclusive_max
bounds for the output space. A bound ofkImplicit
indicates no change.- out
- bool *is_noop¶
Must be non-null. Upon successful return,
*is_noop
is set totrue
if all bounds innew_output_inclusive_min
andnew_output_exclusive_max
arekImplicit
, and is set tofalse
otherwise.
- Returns:¶
absl::Status()
on success.- Error absl::StatusCode::kFailedPrecondition:¶
if
can_resize_tied_bounds == false
and the resize would affect positions outside the range oftransform
.- Error absl::StatusCode::kInvalidArgument:¶
if the requested bound are invalid or incompatible with
transform
.- Error absl::StatusCode::kInvalidArgument:¶
if integer overflow occurs.