-
#include "tensorstore/index_space/index_transform.h" -
Result<bool>
tensorstore::GetOutputRange(IndexTransformView<> transform,
MutableBoxView<> output_range); Computes a hyperrectangle bound on the output range of
transform.In some cases, the computed bound is exactly equal to the range of the transform, meaning for every position
outputin the computed bounding box, there is at least oneinputindex vector such thattransform(input) == output. In other cases, the computed bound is merely a superset of the range of the transform.The computed bound is exact if, and only if, the following two conditions are satisfied:
All output index maps:
are
OutputIndexMethod::constantmaps or have astrideof0, orare
OutputIndexMethod::single_input_dimensionmaps with astrideof1or-1.
No two
OutputIndexMethod::single_input_dimensionoutput index maps depend on the same input dimension (meaning an input dimension correspond to the diagonal of two or more output dimensions).
- Parameters:¶
- IndexTransformView<> transform¶
The index transform for which to compute the output range.
- out
- MutableBoxView<> output_range¶
Reference to box of rank
transform.output_rank().
- Dchecks:¶
transform.output_rank() == output_range.rank().- Returns:¶
trueif the computed bound is guaranteed to be exact, orfalseif the actual range may be a sparse subset of the computed bound.- Error absl::StatusCode::kInvalidArgument:¶
if the transform is invalid.
- Error absl::StatusCode::kInvalidArgument:¶
if integer overflow occurs while computing the result.
Warning
For efficiency, in the case of an
OutputIndexMethod::arrayoutput index map, the output range is computed based solely on the storedindex_rangeinterval; the actual indices in the index array do not affect the result. Furthermore, even if the index array happens to densely cover theindex_rangeinterval, the computed output range will still be considered not to be exact, and the return value will befalse.