A template for a class that randomizes matrices.
More...
#include <jade.randomizer.hpp>
template<typename TValue>
class jade::basic_randomizer< TValue >
A template for a class that randomizes matrices.
Definition at line 19 of file jade.randomizer.hpp.
◆ matrix_type
template<typename TValue >
◆ value_type
template<typename TValue >
◆ verification_type
template<typename TValue >
◆ basic_randomizer()
template<typename TValue >
◆ get_engine()
template<typename TValue >
◆ randomize_f() [1/2]
template<typename TValue >
- Returns
- A random F matrix.
- Parameters
-
K | The component count. |
mu | The mu vector. |
Definition at line 50 of file jade.randomizer.hpp.
55 static const auto epsilon =
value_type(1.0e-6);
56 static const auto min =
value_type(0.0) + epsilon;
57 static const auto max =
value_type(1.0) - epsilon;
60 assert(mu.is_column_vector());
62 { return n >= min && n <= max; }));
64 const auto J = mu.get_length();
68 for (
size_t j = 0; j < J; j++)
70 static std::normal_distribution<value_type>
73 for (
size_t k = 0; k < K; k++)
74 f(k, j) = std::min(std::max(
75 min, dist(_engine)), max);
◆ randomize_f() [2/2]
template<typename TValue >
- Returns
- A random F matrix.
- Parameters
-
K | The component count. |
mu | The mu vector. |
fif | The fin-force matrix. |
Definition at line 84 of file jade.randomizer.hpp.
90 static const auto epsilon =
value_type(1.0e-6);
91 static const auto min =
value_type(0.0) + epsilon;
92 static const auto max =
value_type(1.0) - epsilon;
95 assert(mu.is_column_vector());
97 { return n >= min && n <= max; }));
99 const auto J = mu.get_length();
104 for (
size_t j = 0; j < J; j++)
106 static std::normal_distribution<value_type>
109 for (
size_t k = 0; k < fif.get_height(); k++)
112 for (
size_t k = fif.get_height(); k < K; k++)
113 f(k, j) = std::min(std::max(
114 min, dist(_engine)), max);
◆ randomize_q()
template<typename TValue >
- Returns
- A random Q matrix.
- Parameters
-
I | The number of individuals. |
K | The number of components. |
Definition at line 123 of file jade.randomizer.hpp.
130 static std::uniform_real_distribution<value_type>
131 distribution (K_0, K_1);
135 for (
size_t i = 0; i < I; i++)
138 for (
size_t k = 0; k < K; k++)
139 sum += (q(i, k) = distribution(_engine));
141 const auto factor = K_1 / sum;
142 for (
size_t k = 0; k < K; k++)
The documentation for this class was generated from the following file: