Correction de probl?me de compilation li? a RayTracing.
[GPU.git] / WCudaMSE / Student_Cuda_Image / src / cpp / core / 03_Newton / moo / device / math / NewtonMath.h
index e9b0dd8..d1dffc7 100755 (executable)
@@ -14,6 +14,14 @@ class NewtonMath
             C // (-1/2 -sqrt(3)/2)\r
         };\r
 \r
+        // Les trois solutions du système d'équation : A, B et C (vecteur 2D).\r
+        static const float A1 = 1.0;\r
+        static const float A2 = 0.0;\r
+        static const float B1 = -0.5; // -1.0 / 2.0\r
+        static const float B2 = 0.866025403785; // sqrt(3.0) / 2.0\r
+        static const float C1 = -0.5; // -1.0 / 2.0\r
+        static const float C2 = -0.866025403785; // -sqrt(3.0) / 2.0\r
+\r
     public:\r
         /*\r
          * n est le nombre d'iteration.\r
@@ -30,15 +38,6 @@ class NewtonMath
        __device__\r
        void colorXY(uchar4* ptrColor, float x1, float x2) const\r
            {\r
-            const float A1 = 1.0;\r
-            const float A2 = 0.0;\r
-            const float B1 = -1.0 / 2.0;\r
-            const float B2 = sqrt(3.0) / 2.0;\r
-            const float C1 = -1.0 / 2.0;\r
-            const float C2 = -sqrt(3.0) / 2.0;\r
-\r
-            //const float epsilon = 0.1;\r
-\r
             float nearest_current_solution_distance = FLT_MAX;\r
            Solution nearest_current_solution = A;\r
 \r
@@ -64,7 +63,8 @@ class NewtonMath
                     nearest_current_solution_distance = distance_to_C;\r
                     }\r
 \r
-                /*if (Indice2D::tid() == 0)\r
+                /* For DEBUG.\r
+                 * if (Indice2D::tid() == 0)\r
                     {\r
                     printf("nearest_current_solution_distance: %f\n", nearest_current_solution_distance);\r
                     }*/\r
@@ -73,7 +73,8 @@ class NewtonMath
                     printf("d to a: %f\n", distance_to_A);\r
                     printf("d to a: %f\n", distance_to_B);\r
                     printf("d to a: %f\n", distance_to_C);\r
-                    }*/\r
+                    }\r
+                 */\r
 \r
                 if (nearest_current_solution_distance < this->epsilon)\r
                     break;\r
@@ -112,7 +113,7 @@ class NewtonMath
         __device__\r
         static void nextX(float x1, float x2, float& x1_next, float& x2_next)\r
             {\r
-            float f_x1 = x1 * x1 * x2 - 3.0 * x1 * x2 * x2 - 1.0;\r
+            float f_x1 = x1 * x1 * x1 - 3.0 * x1 * x2 * x2 - 1.0;\r
             float f_x2 = x2 * x2 * x2 - 3.0 * x1 * x1 * x2;\r
 \r
             // La matrice est représentée comme cela :\r