MTL5 -- Matrix Template Library C++ API
mtl:: -- C++20 header-only linear algebra for mixed-precision algorithm design
Loading...
Searching...
No Matches
mtl::array::shape< N > Class Template Reference

Static-rank shape: an array of N extents. More...

#include <shape.hpp>

Public Member Functions

constexpr shape ()=default
constexpr shape (std::array< std::size_t, N > ext)
constexpr shape (std::initializer_list< std::size_t > il)
 Throws std::invalid_argument unless the list has exactly N extents, in every build (#856: an assert, so a longer list was read past N and a shorter one read past its end under NDEBUG).
constexpr std::size_t operator[] (std::size_t i) const
constexpr std::size_t & operator[] (std::size_t i)
constexpr const std::array< std::size_t, N > & extents () const
constexpr std::size_t total_size () const
constexpr bool operator== (const shape &) const =default

Static Public Attributes

static constexpr std::size_t rank = N

Detailed Description

template<std::size_t N>
class mtl::array::shape< N >

Static-rank shape: an array of N extents.

Constructor & Destructor Documentation

◆ shape() [1/3]

template<std::size_t N>
mtl::array::shape< N >::shape ( )
constexprdefault

◆ shape() [2/3]

template<std::size_t N>
mtl::array::shape< N >::shape ( std::array< std::size_t, N > ext)
inlineconstexpr

◆ shape() [3/3]

template<std::size_t N>
mtl::array::shape< N >::shape ( std::initializer_list< std::size_t > il)
inlineconstexpr

Throws std::invalid_argument unless the list has exactly N extents, in every build (#856: an assert, so a longer list was read past N and a shorter one read past its end under NDEBUG).

Member Function Documentation

◆ extents()

template<std::size_t N>
const std::array< std::size_t, N > & mtl::array::shape< N >::extents ( ) const
inlineconstexpr

◆ operator==()

template<std::size_t N>
bool mtl::array::shape< N >::operator== ( const shape< N > & ) const
constexprdefault

◆ operator[]() [1/2]

template<std::size_t N>
std::size_t & mtl::array::shape< N >::operator[] ( std::size_t i)
inlineconstexpr

◆ operator[]() [2/2]

template<std::size_t N>
std::size_t mtl::array::shape< N >::operator[] ( std::size_t i) const
inlineconstexpr

◆ total_size()

template<std::size_t N>
std::size_t mtl::array::shape< N >::total_size ( ) const
inlineconstexpr

Member Data Documentation

◆ rank

template<std::size_t N>
std::size_t mtl::array::shape< N >::rank = N
staticconstexpr

The documentation for this class was generated from the following file:
  • /home/runner/work/mtl5/mtl5/include/mtl/array/shape.hpp