|
MCKL
Monte Carlo Kernel Library
|
Weights of samples. More...
#include <mckl/core/weight.hpp>
Public Types | |
| using | size_type = std::size_t |
Public Member Functions | |
| Weight (size_type N=0) | |
| template<typename InputIter > | |
| void | add_log (InputIter first) |
| Set \(\log W_i = \log W_i + v_i + \mathrm{const.}\). More... | |
| void | add_log (const double *first) |
| Set \(\log W_i = \log W_i + v_i + \mathrm{const.}\). More... | |
| void | add_log (double *first) |
| Set \(\log W_i = \log W_i + v_i + \mathrm{const.}\). More... | |
| const double * | data () const |
| Pointer to data of the normalized weight. More... | |
| template<typename RNGType > | |
| size_type | draw (RNGType &rng) const |
| Draw integer index in the range \([0, N)\) according to the weights. More... | |
| double | ess () const |
| Return the ESS of the particle system. More... | |
| template<typename InputIter > | |
| void | mul (InputIter first) |
| Set \(W_i \propto W_i w_i\). More... | |
| void | mul (const double *first) |
| Set \(W_i \propto W_i w_i\). More... | |
| void | mul (double *first) |
| Set \(W_i \propto W_i w_i\). More... | |
| template<typename OutputIter > | |
| OutputIter | read (OutputIter first) const |
| Read all normalized weights to an output iterator. More... | |
| void | reserve (size_type N) |
| Reserve space. More... | |
| void | resize (size_type N) |
| Resize the Weight object. More... | |
| template<typename InputIter > | |
| void | set (InputIter first) |
| Set \(W_i \propto w_i\). More... | |
| void | set_equal () |
| Set \(W_i = 1/N\). More... | |
| template<typename InputIter > | |
| void | set_exact (double ess, InputIter first) |
| Set exact values of ESS and normalized weights. More... | |
| template<typename InputIter > | |
| void | set_log (InputIter first) |
| Set \(\log W_i = v_i + \mathrm{const.}\). More... | |
| void | shrink_to_fit () |
| Shrink to fit. More... | |
| size_type | size () const |
| Size of this Weight object. More... | |
Friends | |
| bool | is_equal (const Weight &w1, const Weight &w2) |
| bool | operator!= (const Weight &w1, const Weight &w2) |
| bool | operator== (const Weight &w1, const Weight &w2) |
Weights of samples.
Definition at line 44 of file weight.hpp.
| using mckl::Weight::size_type = std::size_t |
Definition at line 47 of file weight.hpp.
|
inlineexplicit |
Definition at line 49 of file weight.hpp.
|
inline |
Set \(\log W_i = \log W_i + v_i + \mathrm{const.}\).
Definition at line 133 of file weight.hpp.
|
inline |
Set \(\log W_i = \log W_i + v_i + \mathrm{const.}\).
Definition at line 143 of file weight.hpp.
|
inline |
Set \(\log W_i = \log W_i + v_i + \mathrm{const.}\).
Definition at line 151 of file weight.hpp.
|
inline |
Pointer to data of the normalized weight.
Definition at line 67 of file weight.hpp.
|
inline |
Draw integer index in the range \([0, N)\) according to the weights.
Definition at line 156 of file weight.hpp.
|
inline |
Return the ESS of the particle system.
Definition at line 64 of file weight.hpp.
|
inline |
Set \(W_i \propto W_i w_i\).
Definition at line 105 of file weight.hpp.
|
inline |
Set \(W_i \propto W_i w_i\).
Definition at line 114 of file weight.hpp.
|
inline |
Set \(W_i \propto W_i w_i\).
Definition at line 121 of file weight.hpp.
|
inline |
Read all normalized weights to an output iterator.
Definition at line 71 of file weight.hpp.
|
inline |
Reserve space.
Definition at line 58 of file weight.hpp.
|
inline |
Resize the Weight object.
Definition at line 55 of file weight.hpp.
|
inline |
Set \(W_i \propto w_i\).
Definition at line 85 of file weight.hpp.
|
inline |
Set \(W_i = 1/N\).
Definition at line 77 of file weight.hpp.
|
inline |
Set exact values of ESS and normalized weights.
This will set the internal state exactly to the input. No check of if the values are really normalized or ESS is correctly calculated
Definition at line 97 of file weight.hpp.
|
inline |
Set \(\log W_i = v_i + \mathrm{const.}\).
Definition at line 125 of file weight.hpp.
|
inline |
Shrink to fit.
Definition at line 61 of file weight.hpp.
|
inline |
Size of this Weight object.
Definition at line 52 of file weight.hpp.
Definition at line 173 of file weight.hpp.
Definition at line 168 of file weight.hpp.
Definition at line 163 of file weight.hpp.
1.8.13