-
#include "tensorstore/index_interval.h"
-
Result<IndexInterval>
tensorstore::ShiftIntervalTo(IndexInterval interval, Index origin); Shifts
interval.inclusive_min()
toorigin
.The size is preserved, unless
interval.inclusive_min() == kInfIndex
.- Parameters:¶
- IndexInterval interval¶
The existing interval to shift.
- Index origin¶
The new
inclusive_min
value.
- Returns:¶
The shifted interval.
- Error absl::StatusCode::kInvalidArgument:¶
if
interval.inclusive_min() == -kInfIndex
. errorabsl::StatusCode::kOutOfRange
iforigin
is outside[kMinFiniteIndex, kMaxFiniteIndex]
.- Error absl::StatusCode::kInvalidArgument:¶
if the resultant
inclusive_max
value would be outside the valid range.