-
#include "tensorstore/index_space/dim_expression.h"
- auto tensorstore::DimExpression<Op...>::Transpose() const;
Transposes the input dimensions such that the selected dimensions are consecutive.
This is equivalent to
MoveToFront()
andMoveToBack()
, but requires that all dimensions are selected. The new dimension selection is{0, ..., input_rank-1}
.For example,
Dims(2, 0, 1).Transpose()
has the following effects:Before
After
Dimension selection
{2, 0, 1}
{0, 1, 2}
Input domain
[1*, 3], [2, 5*], [3, 4]
[3, 4], [1*, 3], [2, 5*]
Labels
{"x", "y", "z"}
{"z", "x", "y"}
Equivalent input indices
{2, 3, 4}
{4, 2, 3}
Equivalent input indices
{x, y, z}
{z, x, y}
where
x
is any index in[1, 3]
,y
is any index in[2, 5]
, andz
is any index in[3, 4]
.