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

#include <vec.h>

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

Public Types

using this_type = vec< ValueType, N >
 
using parent_type = tensor< ValueType, N >
 
using iterator = typename parent_type::array_parent_type::container_type::iterator
 
using const_iterator = typename parent_type::array_parent_type::container_type::const_iterator
 
- Public Types inherited from tatooine::tensor< ValueType, 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 vec ()=default
 
constexpr vec (vec const &)=default
 
constexpr vec (vec &&other) noexcept=default
 
constexpr vec (convertible_to< ValueType > auto &&... ts)
 
template<typename OtherTensor , typename OtherReal >
constexpr vec (base_tensor< OtherTensor, OtherReal, N > const &other)
 
template<typename FillReal >
requires arithmetic<ValueType>
constexpr vec (tag::fill< FillReal > const f)
 
constexpr vec (tag::ones_t const ones)
 
constexpr vec (tag::zeros_t const zeros)
 
template<typename RandomReal , typename Engine >
requires is_arithmetic<ValueType>
constexpr vec (random::uniform< RandomReal, Engine > &&rand)
 
template<arithmetic RandomReal, typename Engine >
constexpr vec (random::uniform< RandomReal, Engine > &rand)
 
template<arithmetic RandomReal, typename Engine >
requires is_arithmetic<ValueType>
constexpr vec (random::normal< RandomReal, Engine > &&rand)
 
template<arithmetic RandomReal, typename Engine >
requires is_arithmetic<ValueType>
constexpr vec (random::normal< RandomReal, Engine > &rand)
 
auto constexpr operator= (vec const &) -> vec &=default
 
auto constexpr operator= (vec &&other) noexcept -> vec &=default
 
template<static_tensor Other>
requires (same_dimensions<this_type, Other>()) && (convertible_to<tatooine::value_type<Other>, value_type>)
auto constexpr operator= (Other &&other) -> vec &
 
 ~vec ()=default
 
auto begin () const
 
auto begin ()
 
auto end () const
 
auto end ()
 
auto size () const
 
auto constexpr x () const -> auto const &requires(N >=1)
 
auto constexpr x () -> auto &requires(N >=1)
 
auto constexpr y () const -> auto const &requires(N >=2)
 
auto constexpr xy () const
 
auto constexpr yx () const
 
auto constexpr y () -> auto &requires(N >=2)
 
auto constexpr xyz () const
 
auto constexpr z () const -> auto const &requires(N >=3)
 
auto constexpr z () -> auto &requires(N >=3)
 
auto constexpr xyzw () const
 
auto constexpr w () const -> auto const &requires(N >=4)
 
auto constexpr w () -> auto &requires(N >=4)
 
- Public Member Functions inherited from tatooine::tensor< ValueType, 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 zeros ()
 
static auto constexpr ones ()
 
static auto constexpr fill (ValueType const &t)
 
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 Public Member Functions inherited from tatooine::tensor< ValueType, 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

◆ const_iterator

template<arithmetic_or_complex ValueType, std::size_t N>
using tatooine::vec< ValueType, N >::const_iterator = typename parent_type::array_parent_type::container_type::const_iterator

◆ iterator

template<arithmetic_or_complex ValueType, std::size_t N>
using tatooine::vec< ValueType, N >::iterator = typename parent_type::array_parent_type::container_type::iterator

◆ parent_type

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

◆ this_type

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

Constructor & Destructor Documentation

◆ vec() [1/12]

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

◆ vec() [2/12]

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

◆ vec() [3/12]

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

◆ vec() [4/12]

template<arithmetic_or_complex ValueType, std::size_t N>
constexpr tatooine::vec< ValueType, N >::vec ( convertible_to< ValueType > auto &&...  ts)
inlineconstexpr

◆ vec() [5/12]

template<arithmetic_or_complex ValueType, std::size_t N>
template<typename OtherTensor , typename OtherReal >
constexpr tatooine::vec< ValueType, N >::vec ( base_tensor< OtherTensor, OtherReal, N > const &  other)
inlineexplicitconstexpr

◆ vec() [6/12]

template<arithmetic_or_complex ValueType, std::size_t N>
template<typename FillReal >
requires arithmetic<ValueType>
constexpr tatooine::vec< ValueType, N >::vec ( tag::fill< FillReal > const  f)
inlineexplicitconstexpr

◆ vec() [7/12]

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

◆ vec() [8/12]

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

◆ vec() [9/12]

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

◆ vec() [10/12]

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

◆ vec() [11/12]

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

◆ vec() [12/12]

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

◆ ~vec()

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

Member Function Documentation

◆ begin() [1/2]

template<arithmetic_or_complex ValueType, std::size_t N>
auto tatooine::vec< ValueType, N >::begin ( )
inline

◆ begin() [2/2]

template<arithmetic_or_complex ValueType, std::size_t N>
auto tatooine::vec< ValueType, N >::begin ( ) const
inline

◆ end() [1/2]

template<arithmetic_or_complex ValueType, std::size_t N>
auto tatooine::vec< ValueType, N >::end ( )
inline

◆ end() [2/2]

template<arithmetic_or_complex ValueType, std::size_t N>
auto tatooine::vec< ValueType, N >::end ( ) const
inline

◆ fill()

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

◆ ones()

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

◆ operator=() [1/3]

template<arithmetic_or_complex ValueType, std::size_t N>
template<static_tensor Other>
requires (same_dimensions<this_type, Other>()) && (convertible_to<tatooine::value_type<Other>, value_type>)
auto constexpr tatooine::vec< ValueType, N >::operator= ( Other &&  other) -> vec&
inlineconstexpr

◆ operator=() [2/3]

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

◆ operator=() [3/3]

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

◆ randn()

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

◆ randu()

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

◆ size()

template<arithmetic_or_complex ValueType, std::size_t N>
auto tatooine::vec< ValueType, N >::size ( ) const
inline

◆ w() [1/2]

template<arithmetic_or_complex ValueType, std::size_t N>
auto constexpr tatooine::vec< ValueType, N >::w ( ) -> auto& requires(N >= 4)
inlineconstexpr

◆ w() [2/2]

template<arithmetic_or_complex ValueType, std::size_t N>
auto constexpr tatooine::vec< ValueType, N >::w ( ) const -> auto const& requires(N >= 4)
inlineconstexpr

◆ x() [1/2]

template<arithmetic_or_complex ValueType, std::size_t N>
auto constexpr tatooine::vec< ValueType, N >::x ( ) -> auto& requires(N >= 1)
inlineconstexpr

◆ x() [2/2]

template<arithmetic_or_complex ValueType, std::size_t N>
auto constexpr tatooine::vec< ValueType, N >::x ( ) const -> auto const& requires(N >= 1)
inlineconstexpr

◆ xy()

template<arithmetic_or_complex ValueType, std::size_t N>
auto constexpr tatooine::vec< ValueType, N >::xy ( ) const
inlineconstexpr

◆ xyz()

template<arithmetic_or_complex ValueType, std::size_t N>
auto constexpr tatooine::vec< ValueType, N >::xyz ( ) const
inlineconstexpr

◆ xyzw()

template<arithmetic_or_complex ValueType, std::size_t N>
auto constexpr tatooine::vec< ValueType, N >::xyzw ( ) const
inlineconstexpr

◆ y() [1/2]

template<arithmetic_or_complex ValueType, std::size_t N>
auto constexpr tatooine::vec< ValueType, N >::y ( ) -> auto& requires(N >= 2)
inlineconstexpr

◆ y() [2/2]

template<arithmetic_or_complex ValueType, std::size_t N>
auto constexpr tatooine::vec< ValueType, N >::y ( ) const -> auto const& requires(N >= 2)
inlineconstexpr

◆ yx()

template<arithmetic_or_complex ValueType, std::size_t N>
auto constexpr tatooine::vec< ValueType, N >::yx ( ) const
inlineconstexpr

◆ z() [1/2]

template<arithmetic_or_complex ValueType, std::size_t N>
auto constexpr tatooine::vec< ValueType, N >::z ( ) -> auto& requires(N >= 3)
inlineconstexpr

◆ z() [2/2]

template<arithmetic_or_complex ValueType, std::size_t N>
auto constexpr tatooine::vec< ValueType, N >::z ( ) const -> auto const& requires(N >= 3)
inlineconstexpr

◆ zeros()

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

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