-
#include "tensorstore/index_space/dimension_permutation.h" -
void tensorstore::TransformOutputDimensionOrder(
IndexTransformView<> transform,
span<const DimensionIndex> output_perm,
span<DimensionIndex> input_perm); Transforms a dimension order for the output space of
transformto a corresponding dimension order for the input space oftransform.If there is a one-to-one onto correspondence between output dimensions and input dimensions via
OutputIndexMethod::single_input_dimensionoutput index maps, theninput_permis simply mapped fromoutput_permaccording to this correspondence, andTransformInputDimensionOrdercomputes the inverse.More generally, a dimension
input_dimininput_permis ordered ascending by the first indexjfor which the output dimensionoutput_perm[j]maps toinput_dimvia aOutputIndexMethod::single_input_dimensionoutput index map, and then by dimension index. Input dimensions with no corresponding output dimension are ordered last.- Parameters:¶
- IndexTransformView<> transform¶
The index transform.
- span<const DimensionIndex> output_perm¶
Permutation of
{0, 1, ..., transform.output_rank()-1}.- out
- span<DimensionIndex> input_perm¶
Pointer to array of length
transform.input_rank().