Advertisement
Guest User

Untitled

a guest
Apr 6th, 2012
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.45 KB | None | 0 0
  1. #include <mylib.h>
  2.  
  3. using namespace mylib;
  4.  
  5. typedef float procType;
  6.  
  7. struct mygen
  8. {
  9.     mygen(double low, double high) : dist(low, high) {}
  10.     double operator()() { return dist(engine); }
  11.  
  12.   private:
  13.  
  14.     std::mt19937 engine;
  15.     std::uniform_real_distribution<> dist;
  16. }
  17.  
  18.  
  19.  
  20. int main(int argc, char ** argv){
  21.  
  22.     static mygen instace(18.3, 18.34);
  23.     for(int i=0; i < 10; i++){
  24.         std::cout << " " << instace();
  25.     }
  26.  
  27.     exit(EXIT_SUCCESS);
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement