-
#include "tensorstore/index_space/dimension_permutation.h" -
void tensorstore::TransformInputDimensionOrder(
IndexTransformView<> transform,
span<const DimensionIndex> input_perm,
span<DimensionIndex> output_perm); Transforms a dimension order for the input space of
transformto a corresponding dimension order for the output space oftransform.If there is a one-to-one onto correspondence between output dimensions and input dimensions via
OutputIndexMethod::single_input_dimensionoutput index maps, thenoutput_permis simply mapped frominput_permaccording to this correspondence, andTransformOutputDimensionOrdercomputes the inverse.More generally, each output dimension
output_dimmapped with aOutputIndexMethod::single_input_dimensionmap is ordered ascending byinv(input_perm)[output_dim], and then by dimension index. Output dimensions without aOutputIndexMethod::single_input_dimensionmap are ordered last, and then by dimension index.- Parameters:¶
- IndexTransformView<> transform¶
The index transform.
- span<const DimensionIndex> input_perm¶
Permutation of
{0, 1, ..., transform.input_rank()-1}.- out
- span<DimensionIndex> output_perm¶
Pointer to array of length
transform.output_rank().