#include <bsta_sampler.h>
Static Public Member Functions | |
static bool | sample (vcl_vector< T > &samples, vcl_vector< float > &p, unsigned cnt, vcl_vector< T > &out) |
put cnt samples into output vector wrt given probabilities. | |
static bool | sample (vcl_vector< T > &samples, vcl_vector< float > &p, unsigned cnt, vcl_vector< T > &out, vnl_random &rng) |
put cnt samples into output vector wrt given probabilities. | |
static bool | sample (const bsta_joint_histogram< float > &jh, unsigned cnt, vcl_vector< vcl_pair< float, float > > &out) |
sample from a joint histogram treating it as a discrete prob distribution. | |
static bool | sample (const bsta_joint_histogram< float > &jh, unsigned cnt, vcl_vector< vcl_pair< float, float > > &out, vnl_random &rng) |
sample from a joint histogram treating it as a discrete prob distribution. | |
static bool | sample_in_likelihood_order (const bsta_joint_histogram< float > &jh, unsigned cnt, vcl_vector< vcl_pair< float, float > > &out) |
sample in the decreasing order of likelihood (i.e. the most likely bin will be returned as the first sample). | |
static bool | sample_in_likelihood_order (const bsta_joint_histogram< float > &jh, unsigned cnt, vcl_vector< vcl_pair< unsigned, unsigned > > &out_indices) |
sample in the decreasing order of likelihood (i.e. the most likely bin will be returned as the first sample). |
Definition at line 22 of file bsta_sampler.h.
bool bsta_sampler< T >::sample | ( | vcl_vector< T > & | samples, |
vcl_vector< float > & | p, | ||
unsigned | cnt, | ||
vcl_vector< T > & | out | ||
) | [static] |
put cnt samples into output vector wrt given probabilities.
wrapper around version with user-provided random generator.
The sum of probabilities should sum to 1 otherwise return false
Definition at line 30 of file bsta_sampler.txx.
bool bsta_sampler< T >::sample | ( | vcl_vector< T > & | samples, |
vcl_vector< float > & | p, | ||
unsigned | cnt, | ||
vcl_vector< T > & | out, | ||
vnl_random & | rng | ||
) | [static] |
put cnt samples into output vector wrt given probabilities.
The sum of probabilities should sum to 1 otherwise return false. User provides seeded random generator
The sum of probabilities should sum to (approx.) 1; otherwise return false
Definition at line 41 of file bsta_sampler.txx.
bool bsta_sampler< T >::sample | ( | const bsta_joint_histogram< float > & | jh, |
unsigned | cnt, | ||
vcl_vector< vcl_pair< float, float > > & | out | ||
) | [static] |
sample from a joint histogram treating it as a discrete prob distribution.
Definition at line 76 of file bsta_sampler.txx.
bool bsta_sampler< T >::sample | ( | const bsta_joint_histogram< float > & | jh, |
unsigned | cnt, | ||
vcl_vector< vcl_pair< float, float > > & | out, | ||
vnl_random & | rng | ||
) | [static] |
sample from a joint histogram treating it as a discrete prob distribution.
User provides seeded random generator
User provided vnl_random
Definition at line 85 of file bsta_sampler.txx.
bool bsta_sampler< T >::sample_in_likelihood_order | ( | const bsta_joint_histogram< float > & | jh, |
unsigned | cnt, | ||
vcl_vector< vcl_pair< float, float > > & | out | ||
) | [static] |
sample in the decreasing order of likelihood (i.e. the most likely bin will be returned as the first sample).
Definition at line 144 of file bsta_sampler.txx.
bool bsta_sampler< T >::sample_in_likelihood_order | ( | const bsta_joint_histogram< float > & | jh, |
unsigned | cnt, | ||
vcl_vector< vcl_pair< unsigned, unsigned > > & | out_indices | ||
) | [static] |
sample in the decreasing order of likelihood (i.e. the most likely bin will be returned as the first sample).
Definition at line 171 of file bsta_sampler.txx.