-
#include "tensorstore/index_space/index_transform.h" -
template <DimensionIndex InputRank,
DimensionIndex OutputRank,
ContainerKind CKind>
absl::Status tensorstore::PropagateBounds(
std::type_identity_t<BoxView<OutputRank>> b_domain,
DimensionSet b_implicit_lower_bounds,
DimensionSet b_implicit_upper_bounds,
const IndexTransform<InputRank, OutputRank, CKind> a_to_b,
std::type_identity_t<MutableBoxView<InputRank>> a_domain,
DimensionSet& a_implicit_lower_bounds,
DimensionSet& a_implicit_upper_bounds); -
template <DimensionIndex InputRank,
DimensionIndex OutputRank,
ContainerKind CKind>
absl::Status tensorstore::PropagateBounds(
std::type_identity_t<BoxView<OutputRank>> b_domain,
DimensionSet b_implicit_lower_bounds,
DimensionSet b_implicit_upper_bounds,
const IndexTransform<InputRank, OutputRank, CKind> a_to_b,
std::type_identity_t<MutableBoxView<InputRank>> a_domain); Propagates bounds on an output index space
bback to each input dimensioninput_dimof the input index spaceaas follows:The
inferred_boundsare computed as the intersection of the bounds due to eachoutput_dimofa_to_bthat specifiesinput_dimas aOutputIndexMethod::single_input_dimensionoutput index map.If the
existing_boundsspecified bya_to_bforinput_dimare explicit, they must be contained ininferred_bounds.The lower and upper bounds
a[input_dim]are set to the corresponding lower or upper bounds fromexisting_boundsif explicit or if no dimensions ofbcontributed toinferred_bounds, or otherwise frominferred_bounds.Each resultant lower/upper bounds for
ais implicit iff:The original bound specified in
a_to_bis implicit; andAll contributing (by way of a
OutputIndexMethod::single_input_dimensionmap) bounds ofbare implicit.
Also checks that any constant output index maps have an output offset within the
bdomain (implicit bounds ofbare ignored).- Parameters:¶
- std::type_identity_t<BoxView<OutputRank>> b_domain¶
The bounds in the
bindex space.- DimensionSet b_implicit_lower_bounds¶
Implicit indicator for each lower bound of
b.- DimensionSet b_implicit_upper_bounds¶
Implicit indicator for each upper bound of
b.- const IndexTransform<InputRank, OutputRank, CKind> a_to_b¶
The transform. May be null to indicate an identity transform.
- out
- std::type_identity_t<MutableBoxView<InputRank>> a_domain¶
The propagated bounds in the
aindex space.- out
- DimensionSet &a_implicit_lower_bounds¶
Propagated implicit indicators for each lower bound of
a.- out
- DimensionSet &a_implicit_upper_bounds¶
Propagated implicit indicators for each upper bound of
a.
- Dchecks:¶
- Dchecks:¶
- Dchecks:¶
- Error absl::StatusCode::kInvalidArgument:¶
if integer overflow occurs when propagating bounds.
- Error absl::StatusCode::kOutOfRange:¶
if the bounds are incompatible.
Warning
This function does not check
OutputIndexMethod::arrayoutput index maps (as they do not influence the inferred bounds). Those must be checked separately.