00001 #ifndef vnl_sample_h_ 00002 #define vnl_sample_h_ 00003 00004 // This is vxl/vnl/vnl_sample.h 00005 00006 00007 //: 00008 // \file 00009 // \brief easy ways to sample from various probability distributions 00010 // \author unknown 00011 00012 00013 00014 00015 //: re-seed the random number generator. 00016 void vnl_sample_reseed(); 00017 00018 //: uniform on [a, b) 00019 double vnl_sample_uniform(double a, double b); 00020 00021 //: two independent samples from a standard normal distribution. 00022 void vnl_sample_normal_2(double *x, double *y); 00023 00024 //: Normal distribution with given mean and standard deviation 00025 double vnl_sample_normal(double mean, double sigma); 00026 00027 // P(X = k) = [kth term in binomial expansion of (p + (1-p))^n] 00028 //int vnl_sample_binomial(int n, int k, double p); 00029 00030 #endif // vnl_sample_h_