Tatooine
Public Types | Public Member Functions | Static Public Member Functions | Static Private Member Functions | Private Attributes | List of all members
tatooine::static_multidim_array< ValueType, IndexOrder, MemLoc, Resolution > Class Template Reference

#include <static_multidim_array.h>

Inheritance diagram for tatooine::static_multidim_array< ValueType, IndexOrder, MemLoc, Resolution >:
[legend]
Collaboration diagram for tatooine::static_multidim_array< ValueType, IndexOrder, MemLoc, Resolution >:
[legend]

Public Types

using size_type = static_multidim_size< IndexOrder, Resolution... >
 
using value_type = ValueType
 
using this_type = static_multidim_array< ValueType, IndexOrder, MemLoc, Resolution... >
 
using container_type = std::conditional_t< std::is_same< MemLoc, stack >::value, std::array< ValueType, num_components()>, std::vector< ValueType > >
 

Public Member Functions

constexpr static_multidim_array (static_multidim_array const &other)=default
 
constexpr static_multidim_array (static_multidim_array &&other) noexcept=default
 
constexpr auto operator= (static_multidim_array const &other) -> static_multidim_array &=default
 
constexpr auto operator= (static_multidim_array &&other) noexcept -> static_multidim_array &=default
 
 ~static_multidim_array ()=default
 
template<typename OtherT , typename OtherIndexing , typename OtherMemLoc >
constexpr static_multidim_array (static_multidim_array< OtherT, OtherIndexing, OtherMemLoc, Resolution... > const &other)
 
template<typename OtherT , typename OtherIndexing , typename OtherMemLoc >
constexpr auto operator= (static_multidim_array< OtherT, OtherIndexing, OtherMemLoc, Resolution... > const &other) -> static_multidim_array &
 
constexpr static_multidim_array (convertible_to< ValueType > auto &&... ts)
 
constexpr static_multidim_array ()
 
template<typename S >
constexpr static_multidim_array (tag::fill< S > const &f)
 
constexpr static_multidim_array (tag::zeros_t)
 
constexpr static_multidim_array (tag::ones_t)
 
 static_multidim_array (std::vector< ValueType > const &data)
 
constexpr static_multidim_array (std::array< ValueType, num_components()> const &data)
 
constexpr static_multidim_array (std::array< ValueType, num_components()> &&data)
 
constexpr static_multidim_array (std::vector< ValueType > &&data)
 
template<typename RandomReal , typename Engine >
requires arithmetic<ValueType>
constexpr static_multidim_array (random::uniform< RandomReal, Engine > &rand)
 
template<typename RandomReal , typename Engine >
requires arithmetic<ValueType>
constexpr static_multidim_array (random::uniform< RandomReal, Engine > &&rand)
 
template<typename RandomReal , typename Engine >
requires arithmetic<ValueType>
constexpr static_multidim_array (random::normal< RandomReal, Engine > &&rand)
 
template<typename RandomReal , typename Engine >
requires arithmetic<ValueType>
constexpr static_multidim_array (random::normal< RandomReal, Engine > &rand)
 
constexpr auto at (integral auto const ... is) const -> const auto &requires(sizeof...(is)==num_dimensions())
 
constexpr auto at (integral auto const ... is) -> auto &requires(sizeof...(is)==num_dimensions())
 
constexpr auto at (integral_range auto const &indices) const -> auto const &
 
constexpr auto at (integral_range auto const &indices) -> auto &
 
constexpr auto operator() (integral auto const ... is) const -> auto const &requires(sizeof...(is)==num_dimensions())
 
constexpr auto operator() (integral auto const ... is) -> auto &
 
constexpr auto operator() (integral_range auto const &indices) const -> const auto &
 
constexpr auto operator() (integral_range auto const &indices) -> auto &
 
constexpr auto operator[] (std::size_t i) -> auto &
 
constexpr auto operator[] (std::size_t i) const -> auto const &
 
constexpr auto internal_container () -> auto &
 
constexpr auto internal_container () const -> auto const &
 
constexpr auto data () -> ValueType *
 
constexpr auto data () const -> ValueType const *
 
template<typename F >
constexpr void unary_operation (F &&f)
 
template<typename F , typename OtherT , typename OtherIndexing , typename OtherMemLoc >
constexpr void binary_operation (F &&f, static_multidim_array< OtherT, OtherIndexing, OtherMemLoc, Resolution... > const &other)
 

Static Public Member Functions

static std::size_t constexpr num_components ()
 
static std::size_t constexpr num_dimensions ()
 
static auto constexpr size ()
 
static auto constexpr plain_index (integral auto const ... indices)
 
static auto plain_index (integral_range auto const &indices)
 
static auto constexpr in_range (integral auto const ... indices)
 
static constexpr auto zeros ()
 
static constexpr auto ones ()
 
template<typename S >
static constexpr auto fill (S &&s)
 
template<typename RandEng = std::mt19937_64>
requires arithmetic<ValueType>
static auto randu (ValueType min=0, ValueType max=1, RandEng &&eng=RandEng{std::random_device{}()})
 
template<typename RandEng = std::mt19937_64>
requires arithmetic<ValueType>
static auto randn (ValueType mean=0, ValueType stddev=1, RandEng &&eng=RandEng{std::random_device{}()})
 

Static Private Member Functions

static constexpr auto init_data (ValueType const init=ValueType{})
 

Private Attributes

container_type m_data_container
 

Member Typedef Documentation

◆ container_type

template<typename ValueType , index_order IndexOrder, memory_location MemLoc, std::size_t... Resolution>
using tatooine::static_multidim_array< ValueType, IndexOrder, MemLoc, Resolution >::container_type = std::conditional_t<std::is_same<MemLoc, stack>::value, std::array<ValueType, num_components()>, std::vector<ValueType> >

◆ size_type

template<typename ValueType , index_order IndexOrder, memory_location MemLoc, std::size_t... Resolution>
using tatooine::static_multidim_array< ValueType, IndexOrder, MemLoc, Resolution >::size_type = static_multidim_size<IndexOrder, Resolution...>

◆ this_type

template<typename ValueType , index_order IndexOrder, memory_location MemLoc, std::size_t... Resolution>
using tatooine::static_multidim_array< ValueType, IndexOrder, MemLoc, Resolution >::this_type = static_multidim_array<ValueType, IndexOrder, MemLoc, Resolution...>

◆ value_type

template<typename ValueType , index_order IndexOrder, memory_location MemLoc, std::size_t... Resolution>
using tatooine::static_multidim_array< ValueType, IndexOrder, MemLoc, Resolution >::value_type = ValueType

Constructor & Destructor Documentation

◆ static_multidim_array() [1/16]

template<typename ValueType , index_order IndexOrder, memory_location MemLoc, std::size_t... Resolution>
constexpr tatooine::static_multidim_array< ValueType, IndexOrder, MemLoc, Resolution >::static_multidim_array ( static_multidim_array< ValueType, IndexOrder, MemLoc, Resolution > const &  other)
constexprdefault

◆ static_multidim_array() [2/16]

template<typename ValueType , index_order IndexOrder, memory_location MemLoc, std::size_t... Resolution>
constexpr tatooine::static_multidim_array< ValueType, IndexOrder, MemLoc, Resolution >::static_multidim_array ( static_multidim_array< ValueType, IndexOrder, MemLoc, Resolution > &&  other)
constexprdefaultnoexcept

◆ ~static_multidim_array()

template<typename ValueType , index_order IndexOrder, memory_location MemLoc, std::size_t... Resolution>
tatooine::static_multidim_array< ValueType, IndexOrder, MemLoc, Resolution >::~static_multidim_array ( )
default

◆ static_multidim_array() [3/16]

template<typename ValueType , index_order IndexOrder, memory_location MemLoc, std::size_t... Resolution>
template<typename OtherT , typename OtherIndexing , typename OtherMemLoc >
constexpr tatooine::static_multidim_array< ValueType, IndexOrder, MemLoc, Resolution >::static_multidim_array ( static_multidim_array< OtherT, OtherIndexing, OtherMemLoc, Resolution... > const &  other)
inlineexplicitconstexpr

◆ static_multidim_array() [4/16]

template<typename ValueType , index_order IndexOrder, memory_location MemLoc, std::size_t... Resolution>
constexpr tatooine::static_multidim_array< ValueType, IndexOrder, MemLoc, Resolution >::static_multidim_array ( convertible_to< ValueType > auto &&...  ts)
inlineexplicitconstexpr

◆ static_multidim_array() [5/16]

template<typename ValueType , index_order IndexOrder, memory_location MemLoc, std::size_t... Resolution>
constexpr tatooine::static_multidim_array< ValueType, IndexOrder, MemLoc, Resolution >::static_multidim_array ( )
inlineconstexpr

◆ static_multidim_array() [6/16]

template<typename ValueType , index_order IndexOrder, memory_location MemLoc, std::size_t... Resolution>
template<typename S >
constexpr tatooine::static_multidim_array< ValueType, IndexOrder, MemLoc, Resolution >::static_multidim_array ( tag::fill< S > const &  f)
inlineexplicitconstexpr

◆ static_multidim_array() [7/16]

template<typename ValueType , index_order IndexOrder, memory_location MemLoc, std::size_t... Resolution>
constexpr tatooine::static_multidim_array< ValueType, IndexOrder, MemLoc, Resolution >::static_multidim_array ( tag::zeros_t  )
inlineexplicitconstexpr

◆ static_multidim_array() [8/16]

template<typename ValueType , index_order IndexOrder, memory_location MemLoc, std::size_t... Resolution>
constexpr tatooine::static_multidim_array< ValueType, IndexOrder, MemLoc, Resolution >::static_multidim_array ( tag::ones_t  )
inlineexplicitconstexpr

◆ static_multidim_array() [9/16]

template<typename ValueType , index_order IndexOrder, memory_location MemLoc, std::size_t... Resolution>
tatooine::static_multidim_array< ValueType, IndexOrder, MemLoc, Resolution >::static_multidim_array ( std::vector< ValueType > const &  data)
inlineexplicit

◆ static_multidim_array() [10/16]

template<typename ValueType , index_order IndexOrder, memory_location MemLoc, std::size_t... Resolution>
constexpr tatooine::static_multidim_array< ValueType, IndexOrder, MemLoc, Resolution >::static_multidim_array ( std::array< ValueType, num_components()> const &  data)
inlineexplicitconstexpr

◆ static_multidim_array() [11/16]

template<typename ValueType , index_order IndexOrder, memory_location MemLoc, std::size_t... Resolution>
constexpr tatooine::static_multidim_array< ValueType, IndexOrder, MemLoc, Resolution >::static_multidim_array ( std::array< ValueType, num_components()> &&  data)
inlineexplicitconstexpr

◆ static_multidim_array() [12/16]

template<typename ValueType , index_order IndexOrder, memory_location MemLoc, std::size_t... Resolution>
constexpr tatooine::static_multidim_array< ValueType, IndexOrder, MemLoc, Resolution >::static_multidim_array ( std::vector< ValueType > &&  data)
inlineexplicitconstexpr

◆ static_multidim_array() [13/16]

template<typename ValueType , index_order IndexOrder, memory_location MemLoc, std::size_t... Resolution>
template<typename RandomReal , typename Engine >
requires arithmetic<ValueType>
constexpr tatooine::static_multidim_array< ValueType, IndexOrder, MemLoc, Resolution >::static_multidim_array ( random::uniform< RandomReal, Engine > &  rand)
inlineexplicitconstexpr

◆ static_multidim_array() [14/16]

template<typename ValueType , index_order IndexOrder, memory_location MemLoc, std::size_t... Resolution>
template<typename RandomReal , typename Engine >
requires arithmetic<ValueType>
constexpr tatooine::static_multidim_array< ValueType, IndexOrder, MemLoc, Resolution >::static_multidim_array ( random::uniform< RandomReal, Engine > &&  rand)
inlineexplicitconstexpr

◆ static_multidim_array() [15/16]

template<typename ValueType , index_order IndexOrder, memory_location MemLoc, std::size_t... Resolution>
template<typename RandomReal , typename Engine >
requires arithmetic<ValueType>
constexpr tatooine::static_multidim_array< ValueType, IndexOrder, MemLoc, Resolution >::static_multidim_array ( random::normal< RandomReal, Engine > &&  rand)
inlineexplicitconstexpr

◆ static_multidim_array() [16/16]

template<typename ValueType , index_order IndexOrder, memory_location MemLoc, std::size_t... Resolution>
template<typename RandomReal , typename Engine >
requires arithmetic<ValueType>
constexpr tatooine::static_multidim_array< ValueType, IndexOrder, MemLoc, Resolution >::static_multidim_array ( random::normal< RandomReal, Engine > &  rand)
inlineexplicitconstexpr

Member Function Documentation

◆ at() [1/4]

template<typename ValueType , index_order IndexOrder, memory_location MemLoc, std::size_t... Resolution>
constexpr auto tatooine::static_multidim_array< ValueType, IndexOrder, MemLoc, Resolution >::at ( integral auto const ...  is) -> auto& requires(sizeof...(is) == num_dimensions())
inlineconstexpr

◆ at() [2/4]

template<typename ValueType , index_order IndexOrder, memory_location MemLoc, std::size_t... Resolution>
constexpr auto tatooine::static_multidim_array< ValueType, IndexOrder, MemLoc, Resolution >::at ( integral auto const ...  is) const -> const auto& requires(sizeof...(is) == num_dimensions())
inlineconstexpr

◆ at() [3/4]

template<typename ValueType , index_order IndexOrder, memory_location MemLoc, std::size_t... Resolution>
constexpr auto tatooine::static_multidim_array< ValueType, IndexOrder, MemLoc, Resolution >::at ( integral_range auto const &  indices) -> auto&
inlineconstexpr

◆ at() [4/4]

template<typename ValueType , index_order IndexOrder, memory_location MemLoc, std::size_t... Resolution>
constexpr auto tatooine::static_multidim_array< ValueType, IndexOrder, MemLoc, Resolution >::at ( integral_range auto const &  indices) const -> auto const&
inlineconstexpr

◆ binary_operation()

template<typename ValueType , index_order IndexOrder, memory_location MemLoc, std::size_t... Resolution>
template<typename F , typename OtherT , typename OtherIndexing , typename OtherMemLoc >
constexpr void tatooine::static_multidim_array< ValueType, IndexOrder, MemLoc, Resolution >::binary_operation ( F &&  f,
static_multidim_array< OtherT, OtherIndexing, OtherMemLoc, Resolution... > const &  other 
)
inlineconstexpr

◆ data() [1/2]

template<typename ValueType , index_order IndexOrder, memory_location MemLoc, std::size_t... Resolution>
constexpr auto tatooine::static_multidim_array< ValueType, IndexOrder, MemLoc, Resolution >::data ( ) -> ValueType*
inlineconstexpr

◆ data() [2/2]

template<typename ValueType , index_order IndexOrder, memory_location MemLoc, std::size_t... Resolution>
constexpr auto tatooine::static_multidim_array< ValueType, IndexOrder, MemLoc, Resolution >::data ( ) const -> ValueType const*
inlineconstexpr

◆ fill()

template<typename ValueType , index_order IndexOrder, memory_location MemLoc, std::size_t... Resolution>
template<typename S >
static constexpr auto tatooine::static_multidim_array< ValueType, IndexOrder, MemLoc, Resolution >::fill ( S &&  s)
inlinestaticconstexpr

◆ in_range()

template<typename ValueType , index_order IndexOrder, memory_location MemLoc, std::size_t... Resolution>
static auto constexpr tatooine::static_multidim_array< ValueType, IndexOrder, MemLoc, Resolution >::in_range ( integral auto const ...  indices)
inlinestaticconstexpr

◆ init_data()

template<typename ValueType , index_order IndexOrder, memory_location MemLoc, std::size_t... Resolution>
static constexpr auto tatooine::static_multidim_array< ValueType, IndexOrder, MemLoc, Resolution >::init_data ( ValueType const  init = ValueType{})
inlinestaticconstexprprivate

◆ internal_container() [1/2]

template<typename ValueType , index_order IndexOrder, memory_location MemLoc, std::size_t... Resolution>
constexpr auto tatooine::static_multidim_array< ValueType, IndexOrder, MemLoc, Resolution >::internal_container ( ) -> auto&
inlineconstexpr

◆ internal_container() [2/2]

template<typename ValueType , index_order IndexOrder, memory_location MemLoc, std::size_t... Resolution>
constexpr auto tatooine::static_multidim_array< ValueType, IndexOrder, MemLoc, Resolution >::internal_container ( ) const -> auto const&
inlineconstexpr

◆ num_components()

template<typename ValueType , index_order IndexOrder, memory_location MemLoc, std::size_t... Resolution>
static std::size_t constexpr tatooine::static_multidim_array< ValueType, IndexOrder, MemLoc, Resolution >::num_components ( )
inlinestaticconstexpr

◆ num_dimensions()

template<typename ValueType , index_order IndexOrder, memory_location MemLoc, std::size_t... Resolution>
static std::size_t constexpr tatooine::static_multidim_array< ValueType, IndexOrder, MemLoc, Resolution >::num_dimensions ( )
inlinestaticconstexpr

◆ ones()

template<typename ValueType , index_order IndexOrder, memory_location MemLoc, std::size_t... Resolution>
static constexpr auto tatooine::static_multidim_array< ValueType, IndexOrder, MemLoc, Resolution >::ones ( )
inlinestaticconstexpr

◆ operator()() [1/4]

template<typename ValueType , index_order IndexOrder, memory_location MemLoc, std::size_t... Resolution>
constexpr auto tatooine::static_multidim_array< ValueType, IndexOrder, MemLoc, Resolution >::operator() ( integral auto const ...  is) -> auto&
inlineconstexpr

◆ operator()() [2/4]

template<typename ValueType , index_order IndexOrder, memory_location MemLoc, std::size_t... Resolution>
constexpr auto tatooine::static_multidim_array< ValueType, IndexOrder, MemLoc, Resolution >::operator() ( integral auto const ...  is) const -> auto const& requires(sizeof...(is) == num_dimensions())
inlineconstexpr

◆ operator()() [3/4]

template<typename ValueType , index_order IndexOrder, memory_location MemLoc, std::size_t... Resolution>
constexpr auto tatooine::static_multidim_array< ValueType, IndexOrder, MemLoc, Resolution >::operator() ( integral_range auto const &  indices) -> auto&
inlineconstexpr

◆ operator()() [4/4]

template<typename ValueType , index_order IndexOrder, memory_location MemLoc, std::size_t... Resolution>
constexpr auto tatooine::static_multidim_array< ValueType, IndexOrder, MemLoc, Resolution >::operator() ( integral_range auto const &  indices) const -> const auto&
inlineconstexpr

◆ operator=() [1/3]

template<typename ValueType , index_order IndexOrder, memory_location MemLoc, std::size_t... Resolution>
constexpr auto tatooine::static_multidim_array< ValueType, IndexOrder, MemLoc, Resolution >::operator= ( static_multidim_array< ValueType, IndexOrder, MemLoc, Resolution > &&  other) -> static_multidim_array &=default
constexprdefaultnoexcept

◆ operator=() [2/3]

template<typename ValueType , index_order IndexOrder, memory_location MemLoc, std::size_t... Resolution>
constexpr auto tatooine::static_multidim_array< ValueType, IndexOrder, MemLoc, Resolution >::operator= ( static_multidim_array< ValueType, IndexOrder, MemLoc, Resolution > const &  other) -> static_multidim_array &=default
constexprdefault

◆ operator=() [3/3]

template<typename ValueType , index_order IndexOrder, memory_location MemLoc, std::size_t... Resolution>
template<typename OtherT , typename OtherIndexing , typename OtherMemLoc >
constexpr auto tatooine::static_multidim_array< ValueType, IndexOrder, MemLoc, Resolution >::operator= ( static_multidim_array< OtherT, OtherIndexing, OtherMemLoc, Resolution... > const &  other) -> static_multidim_array&
inlineconstexpr

◆ operator[]() [1/2]

template<typename ValueType , index_order IndexOrder, memory_location MemLoc, std::size_t... Resolution>
constexpr auto tatooine::static_multidim_array< ValueType, IndexOrder, MemLoc, Resolution >::operator[] ( std::size_t  i) -> auto&
inlineconstexpr

◆ operator[]() [2/2]

template<typename ValueType , index_order IndexOrder, memory_location MemLoc, std::size_t... Resolution>
constexpr auto tatooine::static_multidim_array< ValueType, IndexOrder, MemLoc, Resolution >::operator[] ( std::size_t  i) const -> auto const&
inlineconstexpr

◆ plain_index() [1/2]

template<typename ValueType , index_order IndexOrder, memory_location MemLoc, std::size_t... Resolution>
static auto constexpr tatooine::static_multidim_array< ValueType, IndexOrder, MemLoc, Resolution >::plain_index ( integral auto const ...  indices)
inlinestaticconstexpr

◆ plain_index() [2/2]

template<typename ValueType , index_order IndexOrder, memory_location MemLoc, std::size_t... Resolution>
static auto tatooine::static_multidim_array< ValueType, IndexOrder, MemLoc, Resolution >::plain_index ( integral_range auto const &  indices)
inlinestatic

◆ randn()

template<typename ValueType , index_order IndexOrder, memory_location MemLoc, std::size_t... Resolution>
template<typename RandEng = std::mt19937_64>
requires arithmetic<ValueType>
static auto tatooine::static_multidim_array< ValueType, IndexOrder, MemLoc, Resolution >::randn ( ValueType  mean = 0,
ValueType  stddev = 1,
RandEng &&  eng = RandEng{std::random_device{}()} 
)
inlinestatic

◆ randu()

template<typename ValueType , index_order IndexOrder, memory_location MemLoc, std::size_t... Resolution>
template<typename RandEng = std::mt19937_64>
requires arithmetic<ValueType>
static auto tatooine::static_multidim_array< ValueType, IndexOrder, MemLoc, Resolution >::randu ( ValueType  min = 0,
ValueType  max = 1,
RandEng &&  eng = RandEng{std::random_device{}()} 
)
inlinestatic

◆ size()

template<typename ValueType , index_order IndexOrder, memory_location MemLoc, std::size_t... Resolution>
static auto constexpr tatooine::static_multidim_array< ValueType, IndexOrder, MemLoc, Resolution >::size ( )
inlinestaticconstexpr

◆ unary_operation()

template<typename ValueType , index_order IndexOrder, memory_location MemLoc, std::size_t... Resolution>
template<typename F >
constexpr void tatooine::static_multidim_array< ValueType, IndexOrder, MemLoc, Resolution >::unary_operation ( F &&  f)
inlineconstexpr

◆ zeros()

template<typename ValueType , index_order IndexOrder, memory_location MemLoc, std::size_t... Resolution>
static constexpr auto tatooine::static_multidim_array< ValueType, IndexOrder, MemLoc, Resolution >::zeros ( )
inlinestaticconstexpr

Member Data Documentation

◆ m_data_container

template<typename ValueType , index_order IndexOrder, memory_location MemLoc, std::size_t... Resolution>
container_type tatooine::static_multidim_array< ValueType, IndexOrder, MemLoc, Resolution >::m_data_container
private

The documentation for this class was generated from the following file: