#include "tensorstore/index.h"
using tensorstore::Index = int64_t;

Type for representing a coordinate in, or a extent of, a multi-dimensional array.

A valid index is in the closed interval: [kMinFiniteIndex, kMaxFiniteIndex].

constexpr const Index tensorstore::kMinFiniteIndex =
   
 -0x3ffffffffffffffe;

Minimum supported finite Index value.

constexpr const Index tensorstore::kInfIndex = 0x3fffffffffffffff;

Special Index value representing positive infinity.

constexpr const Index tensorstore::kMaxFiniteIndex =
   
 0x3ffffffffffffffe;

Maximum supported finite Index value.

constexpr const Index tensorstore::kInfSize = 0x7fffffffffffffff;

Special Index value representing an infinite extent for a dimension.

constexpr const Index tensorstore::kMaxFiniteSize =
   
 0x7ffffffffffffffd;

Maximum supported finite Index value.

constexpr const Index tensorstore::kImplicit = -0x8000000000000000;

Special index value that indicates an implicit bound.

constexpr bool tensorstore::IsFiniteIndex(Index index);

Returns true if index is within the finite range: [kMinFiniteIndex, kMaxFiniteIndex].

constexpr bool tensorstore::IsValidIndex(Index index);

Return true if index is within the valid range: [-kInfIndex, +kInfIndex].

constexpr Index
tensorstore::ExplicitIndexOr(Index indexIndex default_value);

Returns index if index != kImplicit, or default_value otherwise.

constexpr bool
tensorstore::ImplicitOrEqual(Index indexIndex expected);

Returns true if index is either kImplicit or expected.