X-Git-Url: http://git.euphorik.ch/index.cgi?a=blobdiff_plain;ds=sidebyside;f=WCudaMSE%2FBilatTools_CPP%2Fsrc%2Fcore%2Ftools%2Fcpp%2FTabTools.cpp;fp=WCudaMSE%2FBilatTools_CPP%2Fsrc%2Fcore%2Ftools%2Fcpp%2FTabTools.cpp;h=db57e32866a57dfc6598d9128ae576e5ddf61276;hb=8d08c12b29c2a14684f35c023ee39e694bb80d25;hp=0000000000000000000000000000000000000000;hpb=226de81f7e1f1fbf4ac79d0d089e8a05ec7159a0;p=GPU.git diff --git a/WCudaMSE/BilatTools_CPP/src/core/tools/cpp/TabTools.cpp b/WCudaMSE/BilatTools_CPP/src/core/tools/cpp/TabTools.cpp new file mode 100755 index 0000000..db57e32 --- /dev/null +++ b/WCudaMSE/BilatTools_CPP/src/core/tools/cpp/TabTools.cpp @@ -0,0 +1,64 @@ +#include +#include +#include +#include + +#include "TabTools.h" +#include "AleaTools.h" + +using std::cout; +using std::endl; + +/*----------------------------------------------------------------------*\ + |* Implementation *| + \*---------------------------------------------------------------------*/ + +/*--------------------------------------*\ + |* Constructor *| + \*-------------------------------------*/ + +TabTools::TabTools() + { + // rien + } + +TabTools::~TabTools() + { + // rien + } + +/*--------------------------------------*\ + |* Methodes *| + \*-------------------------------------*/ + +/*----------------------*\ + |* static *| + \*---------------------*/ + + double TabTools::reduction(double* tab, int n) + { + double sum=0; + for(int i=1;i<=n;i++) + { + sum+=*tab; + tab++; + } + return sum; + } + + void TabTools::init(double* tab,int n,double a) + { + for(int i=1;i<=n;i++) + { + *tab=a; + tab++; + } + } + + + + +/*----------------------------------------------------------------------*\ + |* End *| + \*---------------------------------------------------------------------*/ +