lin
|
Defines a set of functions useful for for initializing the element value of tensor types. More...
Classes | |
class | lin::internal::RandomsGenerator |
Random number generator. More... | |
class | lin::internal::StreamConstants< T, R, C, MR, MC > |
Tensor stream where all element accesses return the same constant value. More... | |
class | lin::internal::StreamDiagonal< E > |
Tensor stream where all elements are zeros expects the elements on on the diagonal specified by an underlying stream. More... | |
class | lin::internal::StreamIdentity< T, R, C, MR, MC > |
Tensor stream where all element accesses specify an identity matrix. More... | |
Functions | |
template<typename T , size_t R, size_t C, size_t MR = R, size_t MC = C> | |
constexpr auto | lin::consts (T t, size_t r=MR, size_t c=MC) |
Creates a constants stream. More... | |
template<class C , std::enable_if_t< internal::has_traits< C >::value, size_t > = 0> | |
constexpr auto | lin::consts (typename C::Traits::elem_t t, size_t r=C::Traits::max_rows, size_t c=C::Traits::max_cols) |
Creates a constants stream. More... | |
template<typename T , size_t R, size_t C, size_t MR = R, size_t MC = C> | |
constexpr auto | lin::nans (size_t r=MR, size_t c=MC) |
Creates a stream of not-a-number values. More... | |
template<class C , std::enable_if_t< internal::has_traits< C >::value, size_t > = 0> | |
constexpr auto | lin::nans (size_t r=C::Traits::max_rows, size_t c=C::Traits::max_cols) |
Creates a stream of not-a-number values. More... | |
template<typename T , size_t R, size_t C, size_t MR = R, size_t MC = C> | |
constexpr auto | lin::ones (size_t r=MR, size_t c=MC) |
Creates a ones stream. More... | |
template<class C , std::enable_if_t< internal::has_traits< C >::value, size_t > = 0> | |
constexpr auto | lin::ones (size_t r=C::Traits::max_rows, size_t c=C::Traits::max_cols) |
Creates a ones stream. More... | |
template<typename T , size_t R, size_t C, size_t MR = R, size_t MC = C> | |
constexpr auto | lin::zeros (size_t r=MR, size_t c=MC) |
Creates a zeros stream. More... | |
template<class C , std::enable_if_t< internal::has_traits< C >::value, size_t > = 0> | |
constexpr auto | lin::zeros (size_t r=C::Traits::max_rows, size_t c=C::Traits::max_cols) |
Creates a zeros stream. More... | |
template<typename T , size_t R, size_t C, size_t MR = R, size_t MC = C> | |
constexpr auto | lin::identity (size_t r=MR, size_t c=MC) |
Creates a stream which evaluates to an identity matrix. More... | |
template<class C , std::enable_if_t< internal::has_traits< C >::value, size_t > = 0> | |
constexpr auto | lin::identity (size_t r=C::Traits::max_rows, size_t c=C::Traits::max_cols) |
Creates a stream which evaluates to an identity matrix. More... | |
template<class C , std::enable_if_t< internal::has_traits< C >::value, size_t > = 0> | |
constexpr auto | lin::rands (internal::RandomsGenerator &rand, size_t r=C::Traits::max_rows, size_t c=C::Traits::max_cols) |
Generates a Matrix or Vector populated with uniform random values between 0 and 1. More... | |
template<class C , std::enable_if_t< internal::has_traits< C >::value, size_t > = 0> | |
constexpr auto | lin::gaussians (internal::RandomsGenerator &rand, size_t r=C::Traits::max_rows, size_t c=C::Traits::max_cols) |
Generates a Matrix or Vector populated with independent gaussian random variables with a mean of 0 and standard deviation of 1. Uses Box–Muller transform. More... | |
Defines a set of functions useful for for initializing the element value of tensor types.
More details to come...
constexpr auto lin::consts | ( | T | t, |
size_t | r = MR , |
||
size_t | c = MC |
||
) |
Creates a constants stream.
T | Stream element type. |
R | Rows at compile time. |
C | Columns at compile time. |
MR | Maximum rows at compile time. |
MC | Maximum columns at compile time. |
[in] | t | Constant value. |
[in] | r | Row count. |
[in] | c | Column count. |
constexpr auto lin::consts | ( | typename C::Traits::elem_t | t, |
size_t | r = C::Traits::max_rows , |
||
size_t | c = C::Traits::max_cols |
||
) |
Creates a constants stream.
C | Tensor type whose traits the returned stream will mimic. |
[in] | t | Constant value. |
[in] | r | Row count. |
[in] | c | Column count. |
constexpr auto lin::nans | ( | size_t | r = MR , |
size_t | c = MC |
||
) |
Creates a stream of not-a-number values.
T | Stream element type. |
R | Rows at compile time. |
C | Columns at compile time. |
MR | Maximum rows at compile time. |
MC | Maximum columns at compile time. |
[in] | r | Row count. |
[in] | c | Column count. |
constexpr auto lin::nans | ( | size_t | r = C::Traits::max_rows , |
size_t | c = C::Traits::max_cols |
||
) |
Creates a stream of not-a-number values.
C | Tensor type whose traits the returned stream will mimic. |
[in] | r | Row count. |
[in] | c | Column count. |
constexpr auto lin::ones | ( | size_t | r = MR , |
size_t | c = MC |
||
) |
Creates a ones stream.
T | Stream element type. |
R | Rows at compile time. |
C | Columns at compile time. |
MR | Maximum rows at compile time. |
MC | Maximum columns at compile time. |
[in] | r | Row count. |
[in] | c | Column count. |
constexpr auto lin::ones | ( | size_t | r = C::Traits::max_rows , |
size_t | c = C::Traits::max_cols |
||
) |
Creates a ones stream.
C | Tensor type whose traits the returned stream will mimic. |
[in] | r | Row count. |
[in] | c | Column count. |
constexpr auto lin::zeros | ( | size_t | r = MR , |
size_t | c = MC |
||
) |
Creates a zeros stream.
T | Stream element type. |
R | Rows at compile time. |
C | Columns at compile time. |
MR | Maximum rows at compile time. |
MC | Maximum columns at compile time. |
[in] | r | Row count. |
[in] | c | Column count. |
constexpr auto lin::zeros | ( | size_t | r = C::Traits::max_rows , |
size_t | c = C::Traits::max_cols |
||
) |
Creates a zeros stream.
C | Tensor type whose traits the returned stream will mimic. |
[in] | r | Row count. |
[in] | c | Column count. |
constexpr auto lin::identity | ( | size_t | r = MR , |
size_t | c = MC |
||
) |
Creates a stream which evaluates to an identity matrix.
T | Stream element type. |
R | Rows at compile time. |
C | Columns at compile time. |
MR | Maximum rows at compile time. |
MC | Maximum columns at compile time. |
[in] | r | Row count. |
[in] | c | Column count. |
constexpr auto lin::identity | ( | size_t | r = C::Traits::max_rows , |
size_t | c = C::Traits::max_cols |
||
) |
Creates a stream which evaluates to an identity matrix.
C | Tensor type whose traits the returned stream will mimic. |
[in] | r | Row count. |
[in] | c | Column count. |
constexpr auto lin::rands | ( | internal::RandomsGenerator & | rand, |
size_t | r = C::Traits::max_rows , |
||
size_t | c = C::Traits::max_cols |
||
) |
Generates a Matrix or Vector populated with uniform random values between 0 and 1.
C | Tensor type whose traits the returned stream will mimic. |
[in,out] | rand | Random number generator. |
[in] | r | Row count. |
[in] | c | Column count. |
constexpr auto lin::gaussians | ( | internal::RandomsGenerator & | rand, |
size_t | r = C::Traits::max_rows , |
||
size_t | c = C::Traits::max_cols |
||
) |
Generates a Matrix or Vector populated with independent gaussian random variables with a mean of 0 and standard deviation of 1. Uses Box–Muller transform.
C | Tensor type whose traits the returned stream will mimic. |
[in,out] | rand | Random number generator. |
[in] | r | Row count. |
[in] | c | Column count. |