Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //file: myclass.h
- status myclass::doThat(param1, param2){
- bool cond = shouldIStop(param1, param2, param3, param4);
- status myStatus = NOTLEAF;
- if(!cond){
- ...
- doSomething(param3, param4);
- ...
- ...
- ...
- doThat(param1, param2, param3, param4);
- }
- else{
- ...
- ...
- myStatus = LEAF;
- ...
- }
- return (myStatus);
- }
- void myclass::doSomething(double treshmin, double treshmax)
- {
- mygen gen(treshmin, treshmax);
- .....
- double curThreshold = gen();
- ...
- }
- //file: utilities.h
- struct mygen
- {
- mygen(double low, double high) : dist(low, high) {}
- double operator()() { return dist(eng); }
- private:
- std::mt19937 engine;
- std::uniform_real_distribution<> dist;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement