X-Git-Url: http://git.euphorik.ch/index.cgi?a=blobdiff_plain;f=WCudaMSE%2FBilatTools_CPP%2Fsrc%2Fcore%2Ftools%2Fheader%2FAleaTools.h;fp=WCudaMSE%2FBilatTools_CPP%2Fsrc%2Fcore%2Ftools%2Fheader%2FAleaTools.h;h=4420132611ca5259ffabd72988304659bd0e5057;hb=8d08c12b29c2a14684f35c023ee39e694bb80d25;hp=0000000000000000000000000000000000000000;hpb=226de81f7e1f1fbf4ac79d0d089e8a05ec7159a0;p=GPU.git diff --git a/WCudaMSE/BilatTools_CPP/src/core/tools/header/AleaTools.h b/WCudaMSE/BilatTools_CPP/src/core/tools/header/AleaTools.h new file mode 100755 index 0000000..4420132 --- /dev/null +++ b/WCudaMSE/BilatTools_CPP/src/core/tools/header/AleaTools.h @@ -0,0 +1,74 @@ +#ifndef ALEATOOLS_H_ +#define ALEATOOLS_H_ + +#include +#include + +/*----------------------------------------------------------------------*\ + |* Declaration *| + \*---------------------------------------------------------------------*/ + + +/** + * Not thread safe, see OpenpTools to obtian random number with parrallel thread + */ +class AleaTools + { + public: + + /*--------------------------------------*\ + |* Constructor *| + \*-------------------------------------*/ + + /** + * practice srand(time(NULL)); + */ + AleaTools(); + + /*--------------------------------------*\ + |* Destructor *| + \*-------------------------------------*/ + + virtual ~AleaTools(); + + /*--------------------------------------*\ + |* Methodes *| + \*-------------------------------------*/ + + /** + * in [a,b] + * Attention : pas thread safe + */ + double uniformeAB(double a,double b); + + /** + * in [0,1] + * Attention : pas thread safe + */ + double uniforme01(void); + + /** + * in [a,b] + * Attention : pas thread safe + */ + int uniformeAB(int a,int b); + + + private: + + /*--------------------------------------*\ + |* Methodes *| + \*-------------------------------------*/ + + /*--------------------------------------*\ + |* Attributs *| + \*-------------------------------------*/ + + }; + +#endif + + +/*----------------------------------------------------------------------*\ + |* End *| + \*---------------------------------------------------------------------*/