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
__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
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
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
__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