Ajout de l'ensemble du workspace.
[GPU.git] / WCudaMSE / BilatTools_CPP / src / core / tools / cpp / namespace_cpu / IndiceTools_CPU.cpp
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 (executable)
index 0000000..b70c829
--- /dev/null
@@ -0,0 +1,35 @@
+#include "IndiceTools_CPU.h"\r
+\r
+/*----------------------------------------------------------------------*\\r
+ |*                    Implementation                                  *|\r
+ \*---------------------------------------------------------------------*/\r
+\r
+/*--------------------------------------*\\r
+ |*            Public                  *|\r
+ \*-------------------------------------*/\r
+\r
+namespace cpu\r
+    {\r
+\r
+    /**\r
+     * s[0,W*H[ --> i[0,H[ j[0,W[\r
+     */\r
+    void IndiceTools::toIJ( int s, int w, int* ptrI, int* ptrJ)\r
+       {\r
+       *ptrI = s / w;\r
+       *ptrJ = s - w * (*ptrI);\r
+       }\r
+\r
+    /**\r
+     * i[0,H[ j[0,W[ --> s[0,W*H[\r
+     */\r
+    int IndiceTools::toS(int W, int i, int j)\r
+       {\r
+       return (i * W) + j;\r
+       }\r
+\r
+    }\r
+/*----------------------------------------------------------------------*\\r
+ |*                    End                                             *|\r
+ \*---------------------------------------------------------------------*/\r
+\r