-
#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
b
back to each input dimensioninput_dim
of the input index spacea
as follows:The
inferred_bounds
are computed as the intersection of the bounds due to eachoutput_dim
ofa_to_b
that specifiesinput_dim
as aOutputIndexMethod::single_input_dimension
output index map.If the
existing_bounds
specified bya_to_b
forinput_dim
are 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_bounds
if explicit or if no dimensions ofb
contributed toinferred_bounds
, or otherwise frominferred_bounds
.Each resultant lower/upper bounds for
a
is implicit iff:The original bound specified in
a_to_b
is implicit; andAll contributing (by way of a
OutputIndexMethod::single_input_dimension
map) bounds ofb
are implicit.
Also checks that any constant output index maps have an output offset within the
b
domain (implicit bounds ofb
are ignored).- Parameters:¶
- std::type_identity_t<BoxView<OutputRank>> b_domain¶
The bounds in the
b
index 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
a
index 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::array
output index maps (as they do not influence the inferred bounds). Those must be checked separately.