vSMC
v3.0.0
Scalable Monte Carlo
|
#include <vsmc/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... | |
template<typename RandomIter > | |
void | add_log (RandomIter first, int stride) |
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 RandomIter > | |
void | mul (RandomIter first, int stride) |
Set \(W_i \propto W_i w_i\). More... | |
template<typename OutputIter > | |
OutputIter | read_weight (OutputIter first) const |
Read all normalized weights to an output iterator. More... | |
template<typename RandomIter > | |
RandomIter | read_weight (RandomIter first, int stride) const |
Read all normalized weights to a random access 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... | |
template<typename RandomIter > | |
void | set (RandomIter first, int stride) |
Set \(W_i \propto w_i\). More... | |
void | set_equal () |
Set \(W_i = 1/N\). More... | |
template<typename InputIter > | |
void | set_log (InputIter first) |
Set \(\log W_i = v_i + \mathrm{const.}\). More... | |
template<typename RandomIter > | |
void | set_log (RandomIter first, int stride) |
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... | |
Weight class.
Definition at line 43 of file weight.hpp.
using vsmc::Weight::size_type = std::size_t |
Definition at line 46 of file weight.hpp.
|
inlineexplicit |
Definition at line 48 of file weight.hpp.
|
inline |
Set \(\log W_i = \log W_i + v_i + \mathrm{const.}\).
Definition at line 181 of file weight.hpp.
|
inline |
Set \(\log W_i = \log W_i + v_i + \mathrm{const.}\).
Definition at line 190 of file weight.hpp.
|
inline |
Set \(\log W_i = \log W_i + v_i + \mathrm{const.}\).
Definition at line 198 of file weight.hpp.
|
inline |
Set \(\log W_i = \log W_i + v_i + \mathrm{const.}\).
Definition at line 202 of file weight.hpp.
|
inline |
Pointer to data of the normalized weight.
Definition at line 76 of file weight.hpp.
|
inline |
Draw integer index in the range \([0, N)\) according to the weights.
Definition at line 218 of file weight.hpp.
|
inline |
Return the ESS of the particle system.
Definition at line 73 of file weight.hpp.
|
inline |
Set \(W_i \propto W_i w_i\).
Definition at line 126 of file weight.hpp.
|
inline |
Set \(W_i \propto W_i w_i\).
Definition at line 134 of file weight.hpp.
|
inline |
Set \(W_i \propto W_i w_i\).
Definition at line 141 of file weight.hpp.
|
inline |
Set \(W_i \propto W_i w_i\).
Definition at line 145 of file weight.hpp.
|
inline |
Read all normalized weights to an output iterator.
Definition at line 80 of file weight.hpp.
|
inline |
Read all normalized weights to a random access iterator.
Definition at line 87 of file weight.hpp.
|
inline |
Reserve space.
Definition at line 67 of file weight.hpp.
|
inline |
Resize the Weight object.
After resizing, if the size changed, equal weights are set
Definition at line 57 of file weight.hpp.
|
inline |
Set \(W_i \propto w_i\).
Definition at line 104 of file weight.hpp.
|
inline |
Set \(W_i \propto w_i\).
Definition at line 112 of file weight.hpp.
|
inline |
Set \(W_i = 1/N\).
Definition at line 96 of file weight.hpp.
|
inline |
Set \(\log W_i = v_i + \mathrm{const.}\).
Definition at line 159 of file weight.hpp.
|
inline |
Set \(\log W_i = v_i + \mathrm{const.}\).
Definition at line 167 of file weight.hpp.
|
inline |
Shrink to fit.
Definition at line 70 of file weight.hpp.
|
inline |
Size of this Weight object.
Definition at line 51 of file weight.hpp.