Advertisement
Guest User

Untitled

a guest
Apr 6th, 2012
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //file: myclass.h
  2.        status myclass::doThat(param1, param2){
  3.            
  4.           bool cond = shouldIStop(param1, param2, param3, param4);
  5.           status myStatus = NOTLEAF;
  6.           if(!cond){
  7.               ...
  8.               doSomething(param3, param4);
  9.               ...
  10.               ...
  11.               ...
  12.               doThat(param1, param2, param3, param4);
  13.           }
  14.           else{
  15.               ...
  16.               ...
  17.               myStatus = LEAF;
  18.               ...
  19.           }
  20.           return (myStatus);
  21.         }
  22.  
  23.     void myclass::doSomething(double treshmin, double treshmax)
  24.     {
  25.         mygen gen(treshmin, treshmax);
  26.                 .....
  27.                 double curThreshold = gen();
  28.                 ...
  29.          }
  30.  
  31. //file: utilities.h
  32. struct mygen
  33. {
  34.     mygen(double low, double high) : dist(low, high) {}
  35.     double operator()() { return dist(eng); }
  36.   private:
  37.  
  38.     std::mt19937 engine;
  39.     std::uniform_real_distribution<> dist;
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement