-
#include "tensorstore/index_space/dimension_identifier.h" -
Result<DimensionIndex>
tensorstore::NormalizeDimensionIndex(DimensionIndex index,
DimensionIndex rank); Normalizes a dimension index in the range
(-rank, rank)to the range[0, rank).- Parameters:¶
- DimensionIndex index¶
The dimension index to normalize. A negative
indexvalue is equivalent toindex + rank(effectively counts from the last dimension).- DimensionIndex rank¶
The rank of the index space.
- Pre:¶
rank >= 0- Returns:¶
- Error absl::StatusCode::kInvalidArgument:¶
if
indexis outside[-rank, rank).