-
#include "tensorstore/rank.h"
- struct tensorstore::RankConstraint;
Represents an optional rank value and provides related operations.
Constructors¶
- constexpr RankConstraint();
- constexpr RankConstraint(DynamicRank);
Constructs with an unspecified rank value (
dynamic_rank
).
- explicit constexpr RankConstraint(DimensionIndex rank);
Constructs with the specified rank value.
- static constexpr RankConstraint FromInlineRank(InlineRank value);
Constructs from an
InlineRank
value, ignoring the inline buffer size.
Data members¶
- DimensionIndex rank = dynamic_rank;
Indicates the rank, or equal to
dynamic_rank
if unknown.
Conversion operators¶
- constexpr operator DimensionIndex() const;
Returns
rank
.
Methods¶
- constexpr bool valid() const;
Returns
true
if this is a valid rank constraint.
Composition¶
-
static constexpr RankConstraint
And(DimensionIndex a, DimensionIndex b); -
static constexpr RankConstraint
And(std::initializer_list<DimensionIndex> constraints); Returns the intersection of the rank constraints.
-
static constexpr RankConstraint
Add(DimensionIndex a, DimensionIndex b); -
static constexpr RankConstraint
Add(std::initializer_list<DimensionIndex> constraints); Adds the rank constraints.
-
static constexpr RankConstraint
Subtract(DimensionIndex a, DimensionIndex b); Subtracts the rank constraints.
Comparison¶
-
static constexpr bool
Implies(DimensionIndex inner, DimensionIndex outer); Returns
true
if any rank satisfyinginner
also satisfiesouter
.
-
static constexpr bool
EqualOrUnspecified(DimensionIndex a, DimensionIndex b); -
static constexpr bool
EqualOrUnspecified(std::initializer_list<DimensionIndex> constraints); Returns
true
if there is at least one rank satisfying all constraints.
-
static constexpr bool
LessOrUnspecified(DimensionIndex a, DimensionIndex b); Returns
true
if some rank satisfyinga
is less than some rank satisfyingb
.
-
static constexpr bool
LessEqualOrUnspecified(DimensionIndex a, DimensionIndex b); Returns
true
if some rank satisfyinga
is less than or equal to some rank satisfyingb
.
-
static constexpr bool
GreaterOrUnspecified(DimensionIndex a, DimensionIndex b); Returns
true
if some rank satisfyinga
is greater than some rank satisfyingb
.
-
static constexpr bool
GreaterEqualOrUnspecified(DimensionIndex a, DimensionIndex b); Returns
true
if some rank satisfyinga
is greater than or equal to some rank satisfyingb
.
Related Functions¶
- constexpr StaticOrDynamicRank<Rank> tensorstore::GetDefaultRank();
If
Rank == dynamic_rank
, returnsdynamic_rank
. Otherwise, returnsStaticRank<Rank>{}
.