#include "tensorstore/index_space/dim_expression.h"
auto tensorstore::DimExpression<Op...>::MoveTo(
    
DimensionIndex target) const;

Transposes the input dimensions such that the selected dimensions are consecutive starting or ending at the specified target position.

For example, Dims(2, 0).MoveTo(1) has the following effects:

Before

After

Dimension selection

{0, 2}

{1, 2}

Input domain

[1, 3], [2, 5], [3, 4]

[2, 5], [3, 4], [1, 3]

Labels

{"x", "y", "z"}

{"y", "z", "x"}

Equivalent input indices

{2, 3, 4}

{3, 4, 2}

Equivalent input indices

{x, y, z}

{y, z, x}

where x is any index in [1, 3], y is any index in [2, 5], and z is any index in [3, 4].

Parameters:
DimensionIndex target

Must be in the range [-input_rank + selection_rank - 1, input_rank - selection_rank]. If target >= 0, target is the new index of the first selected dimension. If target < 0, target + input_rank is the new index of the last selected dimension.

Error absl::StatusCode::kInvalidArgument:

if target is outside the valid range.