#include #include #include #include #include #include using namespace std; int main(int argc, const char *argv[]) { typedef boost::mt19937 GeneratorType; typedef boost::uniform_on_sphere DistributionType; typedef boost::variate_generator VariateType; typedef boost::circular_buffer BufferType; const int BUFSIZE = 10; const int DIM = 2; GeneratorType gen; DistributionType dist(DIM); VariateType variate(gen,dist); gen.seed(11); BufferType buf(BUFSIZE); long n(0); DistributionType::result_type tmp; while (1){ cout << "n: " << n << "\r" << flush; tmp = variate(); buf.push_back(tmp); if (isnan(tmp[0])) { cout << "n: " << n << " " << endl; for (size_t i=0; i