Tatooine
Public Types | Public Member Functions | Static Public Member Functions | List of all members
tatooine::mat< ValueType, M, N > Struct Template Reference

#include <mat.h>

Inheritance diagram for tatooine::mat< ValueType, M, N >:
[legend]
Collaboration diagram for tatooine::mat< ValueType, M, N >:
[legend]

Public Types

using this_type = mat< ValueType, M, N >
 
using parent_type = tensor< ValueType, M, N >
 
- Public Types inherited from tatooine::tensor< ValueType, M, N >
using this_type = tensor< ValueType, Dims... >
 
using tensor_parent_type = base_tensor< this_type, ValueType, Dims... >
 
using value_type = typename tensor_parent_type::value_type
 
using array_parent_type = static_multidim_array< ValueType, x_fastest, stack, Dims... >
 
- Public Types inherited from tatooine::static_multidim_array< ValueType, x_fastest, stack, Dims... >
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 Types inherited from tatooine::base_tensor< tensor< ValueType, Dims... >, ValueType, Dims... >
using value_type = ValueType
 
using tensor_type = tensor< ValueType, Dims... >
 
using this_type = base_tensor< tensor< ValueType, Dims... >, ValueType, Dims... >
 
using parent_type = crtp< tensor< ValueType, Dims... > >
 
using multidim_size_t = static_multidim_size< x_fastest, Dims... >
 
using const_indexed_type = einstein_notation::indexed_static_tensor< tensor< ValueType, Dims... > const &, Is... >
 
using indexed_type = einstein_notation::indexed_static_tensor< tensor< ValueType, Dims... > &, Is... >
 
- Public Types inherited from tatooine::crtp< Derived >
using derived_type = Derived
 

Public Member Functions

constexpr mat ()=default
 
constexpr mat (mat const &)=default
 
constexpr mat (mat &&other) noexcept=default
 
template<static_tensor Other>
requires (same_dimensions<this_type, Other>())
constexpr mat (Other &&other)
 Copies any other tensor with same dimensions. More...
 
template<typename... Rows>
constexpr mat (Rows(&&... rows)[parent_type::dimension(1)])
 
constexpr mat (tag::eye_t)
 Constructs an identity matrix. More...
 
template<convertible_to< ValueType > Fill>
constexpr mat (tag::fill< Fill > const f)
 
constexpr mat (tag::ones_t const ones)
 
constexpr mat (tag::zeros_t const zeros)
 
template<typename RandomReal , typename Engine >
requires is_arithmetic<ValueType>
constexpr mat (random::uniform< RandomReal, Engine > &&rand)
 
template<arithmetic RandomReal, typename Engine >
constexpr mat (random::uniform< RandomReal, Engine > &rand)
 
template<arithmetic RandomReal, typename Engine >
requires is_arithmetic<ValueType>
constexpr mat (random::normal< RandomReal, Engine > &&rand)
 
template<arithmetic RandomReal, typename Engine >
requires is_arithmetic<ValueType>
constexpr mat (random::normal< RandomReal, Engine > &rand)
 
auto constexpr operator= (mat const &) -> mat &=default
 
auto constexpr operator= (mat &&other) noexcept -> mat &=default
 
template<static_tensor Other>
requires (same_dimensions<this_type, Other>())
auto constexpr operator= (Other const &other) noexcept -> mat &
 
 ~mat ()=default
 
auto constexpr row (std::size_t i)
 
auto constexpr row (std::size_t i) const
 
auto constexpr col (std::size_t i)
 
auto constexpr col (std::size_t i) const
 
- Public Member Functions inherited from tatooine::tensor< ValueType, M, N >
constexpr tensor ()=default
 
constexpr tensor (tensor const &)=default
 
constexpr tensor (tensor &&other) noexcept=default
 
constexpr tensor (Ts const &... ts)
 
constexpr tensor (tag::zeros_t zeros)
 
constexpr tensor (tag::ones_t ones)
 
constexpr tensor (tag::fill< FillReal > f)
 
constexpr tensor (random::uniform< RandomReal, Engine > &&rand)
 
constexpr tensor (random::uniform< RandomReal, Engine > &rand)
 
constexpr tensor (random::normal< RandomReal, Engine > &&rand)
 
constexpr tensor (random::normal< RandomReal, Engine > &rand)
 
constexpr tensor (OtherTensor &&other)
 
constexpr auto operator= (tensor const &) -> tensor &=default
 
constexpr auto operator= (tensor &&other) noexcept -> tensor &=default
 
constexpr auto operator= (OtherTensor &&other) -> tensor &
 
 ~tensor ()=default
 
auto constexpr at (integral auto const ... is) -> decltype(auto)
 
auto constexpr at (integral auto const ... is) const -> decltype(auto)
 
auto constexpr at (einstein_notation::index auto const ... is) -> decltype(auto)
 
auto constexpr at (einstein_notation::index auto const ... is) const -> decltype(auto)
 
constexpr auto at (integral_range auto const &indices) const -> auto const &
 
constexpr auto at (integral_range auto const &indices) -> auto &
 
auto constexpr operator() (Is const ... is) -> decltype(auto)
 
auto constexpr operator() (Is const ... is) const -> decltype(auto)
 
constexpr auto operator() (integral_range auto const &indices) const -> const auto &
 
constexpr auto operator() (integral_range auto const &indices) -> auto &
 
auto operator< (tensor< OtherT, Dims... > const &other) const
 
auto unary_operation (F &&f) -> auto &
 
auto binary_operation (F &&f, base_tensor< OtherTensor, OtherT, Dims... > const &other) -> decltype(auto)
 
- Public Member Functions inherited from tatooine::static_multidim_array< ValueType, x_fastest, stack, Dims... >
constexpr static_multidim_array (static_multidim_array const &other)=default
 
constexpr static_multidim_array (static_multidim_array &&other) noexcept=default
 
constexpr static_multidim_array (static_multidim_array< OtherT, OtherIndexing, OtherMemLoc, Resolution... > const &other)
 
constexpr static_multidim_array (convertible_to< ValueType > auto &&... ts)
 
constexpr static_multidim_array ()
 
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)
 
constexpr static_multidim_array (random::uniform< RandomReal, Engine > &rand)
 
constexpr static_multidim_array (random::uniform< RandomReal, Engine > &&rand)
 
constexpr static_multidim_array (random::normal< RandomReal, Engine > &&rand)
 
constexpr static_multidim_array (random::normal< RandomReal, Engine > &rand)
 
constexpr auto operator= (static_multidim_array const &other) -> static_multidim_array &=default
 
constexpr auto operator= (static_multidim_array &&other) noexcept -> static_multidim_array &=default
 
constexpr auto operator= (static_multidim_array< OtherT, OtherIndexing, OtherMemLoc, Resolution... > const &other) -> static_multidim_array &
 
 ~static_multidim_array ()=default
 
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 *
 
constexpr void unary_operation (F &&f)
 
constexpr void binary_operation (F &&f, static_multidim_array< OtherT, OtherIndexing, OtherMemLoc, Resolution... > const &other)
 
- Public Member Functions inherited from tatooine::base_tensor< tensor< ValueType, Dims... >, ValueType, Dims... >
constexpr base_tensor ()=default
 
constexpr base_tensor (Other &&other)
 
auto constexpr operator= (Other &&other) -> base_tensor &
 
auto constexpr assign (Other &&other) -> void
 
auto constexpr at (Is const ...)
 
auto constexpr at (Is const ...) const
 
auto constexpr at (integral auto const ... is) const -> decltype(auto) requires(sizeof...(is)==rank())
 
auto constexpr at (integral auto const ... is) -> decltype(auto) requires(sizeof...(is)==rank())
 
auto constexpr at (integral_range auto const &is) -> decltype(auto)
 
auto constexpr at (integral_range auto const &is) const -> decltype(auto)
 
auto constexpr operator() (Is const ... is) const
 
auto constexpr operator() (Is const ... is)
 
auto constexpr operator() (integral auto const ... is) const -> decltype(auto) requires(sizeof...(is)==rank())
 
auto constexpr operator() (integral auto const ... is) -> decltype(auto) requires(sizeof...(is)==rank())
 
auto constexpr slice (std::size_t fixed_index, std::index_sequence< Is... >) -> decltype(auto)
 
auto constexpr slice (std::size_t fixed_index) -> decltype(auto)
 
auto constexpr slice (std::size_t fixed_index, std::index_sequence< Is... >) const
 
auto constexpr slice (std::size_t fixed_index) const
 
auto operator+= (base_tensor< OtherTensor, OtherValueType, Dims... > const &other) -> auto &
 
auto operator+= (convertible_to< ValueType > auto const &other) -> auto &
 
auto operator-= (base_tensor< OtherTensor, OtherValueType, Dims... > const &other) -> auto &
 
auto operator-= (convertible_to< ValueType > auto const &other) -> auto &
 
auto operator*= (convertible_to< ValueType > auto const &other) -> auto &
 
auto operator/= (convertible_to< ValueType > auto const &other) -> auto &
 
auto isnan () const
 
auto isinf () const
 
- Public Member Functions inherited from tatooine::crtp< Derived >
constexpr auto as_derived () -> derived_type &
 returns casted as_derived data More...
 
constexpr auto as_derived () const -> derived_type const &
 returns casted as_derived data More...
 

Static Public Member Functions

static auto constexpr num_rows ()
 
static auto constexpr num_columns ()
 
static auto constexpr zeros ()
 
static auto constexpr ones ()
 
static auto constexpr fill (ValueType const &v)
 
static auto constexpr nans ()
 
static auto constexpr eye ()
 
template<typename RandEng = std::mt19937_64>
static auto constexpr randu (ValueType min=0, ValueType max=1, RandEng &&eng=RandEng{std::random_device{}()})
 
template<typename RandEng = std::mt19937_64>
static auto constexpr randn (ValueType mean=0, ValueType stddev=1, RandEng &&eng=RandEng{std::random_device{}()})
 
static auto constexpr vander (fixed_size_vec< N > auto const &v)
 
static auto constexpr vander (convertible_to< ValueType > auto &&... xs)
 
- Static Public Member Functions inherited from tatooine::tensor< ValueType, M, N >
static constexpr auto zeros ()
 
static constexpr auto ones ()
 
static constexpr auto fill (ValueType const &t)
 
static constexpr auto randu (ValueType min=0, ValueType max=1, RandEng &&eng=RandEng{std::random_device{}()})
 
static constexpr auto randn (ValueType mean=0, ValueType stddev=1, RandEng &&eng=RandEng{std::random_device{}()})
 
static auto constexpr dimension (std::size_t const i)
 
static auto constexpr num_components ()
 
static auto constexpr rank ()
 
- Static Public Member Functions inherited from tatooine::static_multidim_array< ValueType, x_fastest, stack, Dims... >
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 ()
 
static constexpr auto fill (S &&s)
 
static auto randu (ValueType min=0, ValueType max=1, RandEng &&eng=RandEng{std::random_device{}()})
 
static auto randn (ValueType mean=0, ValueType stddev=1, RandEng &&eng=RandEng{std::random_device{}()})
 
- Static Public Member Functions inherited from tatooine::base_tensor< tensor< ValueType, Dims... >, ValueType, Dims... >
static auto constexpr rank ()
 
static auto constexpr num_components ()
 
static auto constexpr dimensions ()
 
static auto constexpr dimension (std::size_t const i)
 
static auto constexpr is_static () -> bool
 
static auto constexpr is_tensor () -> bool
 
static auto constexpr indices ()
 
static auto constexpr for_indices (invocable< decltype(Dims)... > auto &&f)
 
static auto constexpr array_index (integral auto const ... is)
 

Member Typedef Documentation

◆ parent_type

template<arithmetic_or_complex ValueType, std::size_t M, std::size_t N>
using tatooine::mat< ValueType, M, N >::parent_type = tensor<ValueType, M, N>

◆ this_type

template<arithmetic_or_complex ValueType, std::size_t M, std::size_t N>
using tatooine::mat< ValueType, M, N >::this_type = mat<ValueType, M, N>

Constructor & Destructor Documentation

◆ mat() [1/13]

template<arithmetic_or_complex ValueType, std::size_t M, std::size_t N>
constexpr tatooine::mat< ValueType, M, N >::mat ( )
constexprdefault

◆ mat() [2/13]

template<arithmetic_or_complex ValueType, std::size_t M, std::size_t N>
constexpr tatooine::mat< ValueType, M, N >::mat ( mat< ValueType, M, N > const &  )
constexprdefault

◆ mat() [3/13]

template<arithmetic_or_complex ValueType, std::size_t M, std::size_t N>
constexpr tatooine::mat< ValueType, M, N >::mat ( mat< ValueType, M, N > &&  other)
constexprdefaultnoexcept

◆ mat() [4/13]

template<arithmetic_or_complex ValueType, std::size_t M, std::size_t N>
template<static_tensor Other>
requires (same_dimensions<this_type, Other>())
constexpr tatooine::mat< ValueType, M, N >::mat ( Other &&  other)
inlineexplicitconstexpr

Copies any other tensor with same dimensions.

◆ mat() [5/13]

template<arithmetic_or_complex ValueType, std::size_t M, std::size_t N>
template<typename... Rows>
constexpr tatooine::mat< ValueType, M, N >::mat ( Rows(&&... rows)  [parent_type::dimension(1)])
inlineexplicitconstexpr

◆ mat() [6/13]

template<arithmetic_or_complex ValueType, std::size_t M, std::size_t N>
constexpr tatooine::mat< ValueType, M, N >::mat ( tag::eye_t  )
inlineexplicitconstexpr

Constructs an identity matrix.

◆ mat() [7/13]

template<arithmetic_or_complex ValueType, std::size_t M, std::size_t N>
template<convertible_to< ValueType > Fill>
constexpr tatooine::mat< ValueType, M, N >::mat ( tag::fill< Fill > const  f)
inlineexplicitconstexpr

◆ mat() [8/13]

template<arithmetic_or_complex ValueType, std::size_t M, std::size_t N>
constexpr tatooine::mat< ValueType, M, N >::mat ( tag::ones_t const  ones)
inlineexplicitconstexpr

◆ mat() [9/13]

template<arithmetic_or_complex ValueType, std::size_t M, std::size_t N>
constexpr tatooine::mat< ValueType, M, N >::mat ( tag::zeros_t const  zeros)
inlineexplicitconstexpr

◆ mat() [10/13]

template<arithmetic_or_complex ValueType, std::size_t M, std::size_t N>
template<typename RandomReal , typename Engine >
requires is_arithmetic<ValueType>
constexpr tatooine::mat< ValueType, M, N >::mat ( random::uniform< RandomReal, Engine > &&  rand)
inlineexplicitconstexpr

◆ mat() [11/13]

template<arithmetic_or_complex ValueType, std::size_t M, std::size_t N>
template<arithmetic RandomReal, typename Engine >
constexpr tatooine::mat< ValueType, M, N >::mat ( random::uniform< RandomReal, Engine > &  rand)
inlineexplicitconstexpr

◆ mat() [12/13]

template<arithmetic_or_complex ValueType, std::size_t M, std::size_t N>
template<arithmetic RandomReal, typename Engine >
requires is_arithmetic<ValueType>
constexpr tatooine::mat< ValueType, M, N >::mat ( random::normal< RandomReal, Engine > &&  rand)
inlineexplicitconstexpr

◆ mat() [13/13]

template<arithmetic_or_complex ValueType, std::size_t M, std::size_t N>
template<arithmetic RandomReal, typename Engine >
requires is_arithmetic<ValueType>
constexpr tatooine::mat< ValueType, M, N >::mat ( random::normal< RandomReal, Engine > &  rand)
inlineexplicitconstexpr

◆ ~mat()

template<arithmetic_or_complex ValueType, std::size_t M, std::size_t N>
tatooine::mat< ValueType, M, N >::~mat ( )
default

Member Function Documentation

◆ col() [1/2]

template<arithmetic_or_complex ValueType, std::size_t M, std::size_t N>
auto constexpr tatooine::mat< ValueType, M, N >::col ( std::size_t  i)
inlineconstexpr

◆ col() [2/2]

template<arithmetic_or_complex ValueType, std::size_t M, std::size_t N>
auto constexpr tatooine::mat< ValueType, M, N >::col ( std::size_t  i) const
inlineconstexpr

◆ eye()

template<arithmetic_or_complex ValueType, std::size_t M, std::size_t N>
static auto constexpr tatooine::mat< ValueType, M, N >::eye ( )
inlinestaticconstexpr

◆ fill()

template<arithmetic_or_complex ValueType, std::size_t M, std::size_t N>
static auto constexpr tatooine::mat< ValueType, M, N >::fill ( ValueType const &  v)
inlinestaticconstexpr

◆ nans()

template<arithmetic_or_complex ValueType, std::size_t M, std::size_t N>
static auto constexpr tatooine::mat< ValueType, M, N >::nans ( )
inlinestaticconstexpr

◆ num_columns()

template<arithmetic_or_complex ValueType, std::size_t M, std::size_t N>
static auto constexpr tatooine::mat< ValueType, M, N >::num_columns ( )
inlinestaticconstexpr

◆ num_rows()

template<arithmetic_or_complex ValueType, std::size_t M, std::size_t N>
static auto constexpr tatooine::mat< ValueType, M, N >::num_rows ( )
inlinestaticconstexpr

◆ ones()

template<arithmetic_or_complex ValueType, std::size_t M, std::size_t N>
static auto constexpr tatooine::mat< ValueType, M, N >::ones ( )
inlinestaticconstexpr

◆ operator=() [1/3]

template<arithmetic_or_complex ValueType, std::size_t M, std::size_t N>
auto constexpr tatooine::mat< ValueType, M, N >::operator= ( mat< ValueType, M, N > &&  other) -> mat &=default
constexprdefaultnoexcept

◆ operator=() [2/3]

template<arithmetic_or_complex ValueType, std::size_t M, std::size_t N>
auto constexpr tatooine::mat< ValueType, M, N >::operator= ( mat< ValueType, M, N > const &  ) -> mat &=default
constexprdefault

◆ operator=() [3/3]

template<arithmetic_or_complex ValueType, std::size_t M, std::size_t N>
template<static_tensor Other>
requires (same_dimensions<this_type, Other>())
auto constexpr tatooine::mat< ValueType, M, N >::operator= ( Other const &  other) -> mat&
inlineconstexprnoexcept

◆ randn()

template<arithmetic_or_complex ValueType, std::size_t M, std::size_t N>
template<typename RandEng = std::mt19937_64>
static auto constexpr tatooine::mat< ValueType, M, N >::randn ( ValueType  mean = 0,
ValueType  stddev = 1,
RandEng &&  eng = RandEng{std::random_device{}()} 
)
inlinestaticconstexpr

◆ randu()

template<arithmetic_or_complex ValueType, std::size_t M, std::size_t N>
template<typename RandEng = std::mt19937_64>
static auto constexpr tatooine::mat< ValueType, M, N >::randu ( ValueType  min = 0,
ValueType  max = 1,
RandEng &&  eng = RandEng{std::random_device{}()} 
)
inlinestaticconstexpr

◆ row() [1/2]

template<arithmetic_or_complex ValueType, std::size_t M, std::size_t N>
auto constexpr tatooine::mat< ValueType, M, N >::row ( std::size_t  i)
inlineconstexpr

◆ row() [2/2]

template<arithmetic_or_complex ValueType, std::size_t M, std::size_t N>
auto constexpr tatooine::mat< ValueType, M, N >::row ( std::size_t  i) const
inlineconstexpr

◆ vander() [1/2]

template<arithmetic_or_complex ValueType, std::size_t M, std::size_t N>
static auto constexpr tatooine::mat< ValueType, M, N >::vander ( convertible_to< ValueType > auto &&...  xs)
inlinestaticconstexpr

◆ vander() [2/2]

template<arithmetic_or_complex ValueType, std::size_t M, std::size_t N>
static auto constexpr tatooine::mat< ValueType, M, N >::vander ( fixed_size_vec< N > auto const &  v)
inlinestaticconstexpr

◆ zeros()

template<arithmetic_or_complex ValueType, std::size_t M, std::size_t N>
static auto constexpr tatooine::mat< ValueType, M, N >::zeros ( )
inlinestaticconstexpr

The documentation for this struct was generated from the following files: