X-Git-Url: http://git.euphorik.ch/index.cgi?a=blobdiff_plain;f=WCudaMSE%2FBilatTools_CPP%2Fsrc%2Fcore%2Ftools%2Fcpp%2FVariateurI.cpp;fp=WCudaMSE%2FBilatTools_CPP%2Fsrc%2Fcore%2Ftools%2Fcpp%2FVariateurI.cpp;h=a1c7d5658043bd44fa1759665dfc28c1894f5b83;hb=8d08c12b29c2a14684f35c023ee39e694bb80d25;hp=0000000000000000000000000000000000000000;hpb=226de81f7e1f1fbf4ac79d0d089e8a05ec7159a0;p=GPU.git diff --git a/WCudaMSE/BilatTools_CPP/src/core/tools/cpp/VariateurI.cpp b/WCudaMSE/BilatTools_CPP/src/core/tools/cpp/VariateurI.cpp new file mode 100755 index 0000000..a1c7d56 --- /dev/null +++ b/WCudaMSE/BilatTools_CPP/src/core/tools/cpp/VariateurI.cpp @@ -0,0 +1,89 @@ +#include "VariateurI.h" +#include + +/*----------------------------------------------------------------------*\ + |* Declaration *| + \*---------------------------------------------------------------------*/ + +/*--------------------------------------*\ + |* Public *| + \*-------------------------------------*/ + +/*--------------------------------------*\ + |* Private *| + \*-------------------------------------*/ + +/*----------------------------------------------------------------------*\ + |* Implementation *| + \*---------------------------------------------------------------------*/ + +/*--------------------------------------*\ + |* Public *| + \*-------------------------------------*/ + +VariateurI::VariateurI(const IntervalI& range, int dt) + { + this->dt = dt; + this->tMin = range.a; + this->tMax = range.b; + + // Tools + this->isCroisssantPhase = true; + this->t =range.a; + + assert(tMin= tMax) + { + isCroisssantPhase = false; + t -= dt; + } + else + { + t += dt; + } + } + else + { + if (t <= tMin) + { + isCroisssantPhase = true; + t += dt; + } + else + { + t -= dt; + } + } + + return t; + } + +int VariateurI::get() + { + return t; + } + +/*--------------------------------------*\ + |* Private *| + \*-------------------------------------*/ + +/*----------------------------------------------------------------------*\ + |* End *| + \*---------------------------------------------------------------------*/ +