#include "tensorstore/chunk_layout.h"
struct tensorstore::ChunkLayout::InnerOrder
   
 : public ContiguousLayoutPermutation<>;

Specifies the data storage order within innermost chunks as a permutation of [0, ..., rank-1].

Example:

tensorstore::ChunkLayout constraints;

// Sets a soft constraint on the storage order.
TENSORSTORE_RETURN_IF_ERROR(constraints.Set(
    tensorstore::ChunkLayout::InnerOrder{
        {1, 2, 0}, /*hard_constraint=*/false}));
EXPECT_THAT(constraints.inner_order(),
            ::testing::ElementsAre(1, 2, 0));
EXPECT_EQ(false, constraints.inner_order().hard_constraint);

// Overrides the soft constraint with a hard constraint.
TENSORSTORE_RETURN_IF_ERROR(constraints.Set(
    tensorstore::ChunkLayout::InnerOrder{
        {1, 0, 2}, /*hard_constraint=*/true}));
EXPECT_THAT(constraints.inner_order(),
            ::testing::ElementsAre(1, 0, 2));
EXPECT_EQ(true, constraints.inner_order().hard_constraint);

Constructors

explicit InnerOrder();

Constructs an unspecified order.

explicit InnerOrder(span<const DimensionIndex> s,
                    
bool hard_constraint = true);
explicit InnerOrder(const DimensionIndex (&s)[N],
                    
bool hard_constraint = true);

Constructs from the specified order.

Methods

bool valid() const;

Returns true if this specifies an order constraint.

Friend functions

friend bool operator==(const InnerOrderaconst InnerOrderb);
friend bool operator!=(const InnerOrderaconst InnerOrderb);

Compares two order constraints for equality.

Data members

bool hard_constraint = {false};

Indicates whether the data storage order is a hard constraint.