|
| | Shape () noexcept=default |
| | Creates an empty shape.
|
template<Integral... Dims>
requires (sizeof...(Dims) > 0) |
| | Shape (Dims... dims) |
| | Creates a shape from positive integer dimension lengths.
|
| | Shape (std::initializer_list< std::size_t > list, allow_zero_t allow_zero) |
| | Creates a shape from dimension lengths without rejecting zero dimensions.
|
| | Shape (const Buffer< std::size_t > &dims) |
| | Creates a shape by copying dimension lengths from a buffer.
|
| | Shape (const Buffer< std::size_t > &dims, allow_zero_t allow_zero) |
| | Creates a shape by copying dimension lengths without rejecting zero dimensions.
|
| | Shape (Buffer< std::size_t > &&dims) |
| | Creates a shape by taking ownership of dimension lengths from a buffer.
|
| | Shape (Buffer< std::size_t > &&dims, allow_zero_t allow_zero) |
| | Creates a shape by taking ownership of dimensions without rejecting zero dimensions.
|
| | ~Shape ()=default |
| | Destroys the shape.
|
| std::size_t | elements () const |
| | Returns the total number of elements described by the shape.
|
| std::size_t | rank () const |
| | Returns the number of stored dimensions.
|
| const std::size_t & | operator() (std::size_t index) const |
| | Returns the length of a specific dimension.
|
| bool | empty () const noexcept |
| | Returns whether the shape has no dimensions.
|
| bool | operator== (const Shape &other) const noexcept |
| | Compares two shapes for exact rank and dimension equality.
|
| bool | operator!= (const Shape &other) const noexcept |
| | Returns whether two shapes differ in rank or dimension values.
|
| auto | begin () noexcept |
| | Returns an iterator to the first stored dimension.
|
| auto | end () noexcept |
| | Returns an iterator one past the last stored dimension.
|
| auto | begin () const noexcept |
| | Returns a const iterator to the first stored dimension.
|
| auto | end () const noexcept |
| | Returns a const iterator one past the last stored dimension.
|
| void | swap (Shape &other) noexcept |
| | Swaps the stored dimensions with another shape.
|
Stores a list of dimension lengths for an array shape.
Shape tracks rank, dimension sizes, and derived element counts for Stratax containers. It provides lightweight metadata only and does not own any element storage.
Definition at line 19 of file Shape.hpp.
template<Integral... Dims>
requires (sizeof...(Dims) > 0)
| stratax::core::Shape::Shape |
( |
Dims... | dims | ) |
|
|
inline |
Creates a shape from positive integer dimension lengths.
The dimensions are stored in order, from outermost axis to innermost axis. Boolean and character-like types are rejected by the Integral concept.
- Parameters
-
Definition at line 56 of file Shape.hpp.
References Shape().
| std::size_t stratax::core::Shape::elements |
( |
| ) |
const |
|
inlinenodiscard |