X-Git-Url: http://git.euphorik.ch/index.cgi?a=blobdiff_plain;f=WCudaMSE%2FBilatTools_CPP%2Fsrc%2Fcore%2Ftools%2Fcpp%2Fnamespace_cpu%2FIndiceTools_CPU.cpp;fp=WCudaMSE%2FBilatTools_CPP%2Fsrc%2Fcore%2Ftools%2Fcpp%2Fnamespace_cpu%2FIndiceTools_CPU.cpp;h=b70c829a2de260f22bc3448ec5cc2886f4d3e093;hb=8d08c12b29c2a14684f35c023ee39e694bb80d25;hp=0000000000000000000000000000000000000000;hpb=226de81f7e1f1fbf4ac79d0d089e8a05ec7159a0;p=GPU.git diff --git a/WCudaMSE/BilatTools_CPP/src/core/tools/cpp/namespace_cpu/IndiceTools_CPU.cpp b/WCudaMSE/BilatTools_CPP/src/core/tools/cpp/namespace_cpu/IndiceTools_CPU.cpp new file mode 100755 index 0000000..b70c829 --- /dev/null +++ b/WCudaMSE/BilatTools_CPP/src/core/tools/cpp/namespace_cpu/IndiceTools_CPU.cpp @@ -0,0 +1,35 @@ +#include "IndiceTools_CPU.h" + +/*----------------------------------------------------------------------*\ + |* Implementation *| + \*---------------------------------------------------------------------*/ + +/*--------------------------------------*\ + |* Public *| + \*-------------------------------------*/ + +namespace cpu + { + + /** + * s[0,W*H[ --> i[0,H[ j[0,W[ + */ + void IndiceTools::toIJ( int s, int w, int* ptrI, int* ptrJ) + { + *ptrI = s / w; + *ptrJ = s - w * (*ptrI); + } + + /** + * i[0,H[ j[0,W[ --> s[0,W*H[ + */ + int IndiceTools::toS(int W, int i, int j) + { + return (i * W) + j; + } + + } +/*----------------------------------------------------------------------*\ + |* End *| + \*---------------------------------------------------------------------*/ +