Go to the documentation of this file.00001
00002 #ifndef bsta_sampler_h_
00003 #define bsta_sampler_h_
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #include <vcl_vector.h>
00017 #include <vcl_utility.h>
00018 #include <vnl/vnl_random.h>
00019 #include <bsta/bsta_joint_histogram.h>
00020
00021 template <class T>
00022 class bsta_sampler
00023 {
00024 public:
00025
00026
00027 static bool sample(vcl_vector<T>& samples, vcl_vector<float>& p,
00028 unsigned cnt, vcl_vector<T>& out);
00029
00030
00031
00032
00033 static bool sample(vcl_vector<T>& samples, vcl_vector<float>& p,
00034 unsigned cnt, vcl_vector<T>& out, vnl_random &rng);
00035
00036
00037 static bool sample(const bsta_joint_histogram<float>& jh, unsigned cnt, vcl_vector<vcl_pair<float, float> >& out);
00038
00039
00040
00041 static bool sample(const bsta_joint_histogram<float>& jh, unsigned cnt, vcl_vector<vcl_pair<float, float> >& out, vnl_random &rng);
00042
00043
00044 static bool sample_in_likelihood_order(const bsta_joint_histogram<float>& jh, unsigned cnt, vcl_vector<vcl_pair<float, float> >& out);
00045
00046
00047 static bool sample_in_likelihood_order(const bsta_joint_histogram<float>& jh, unsigned cnt, vcl_vector<vcl_pair<unsigned, unsigned> >& out_indices);
00048 };
00049
00050 #endif // bsta_sampler_h_