Commit 79ad3557 authored by Célestin Marot's avatar Célestin Marot
Browse files

added two new cases in the benchmark

parent 2a8fe1e5
......@@ -154,7 +154,7 @@ static int benchmark(double coord[][3], int numCoord, unsigned char face[][3], i
}
}
if(!found) {
fprintf(stderr, "rewind was not done properly\n", j);
fprintf(stderr, "rewind was not done properly\n");
return 5;
}
}
......@@ -166,7 +166,7 @@ static int benchmark(double coord[][3], int numCoord, unsigned char face[][3], i
fflush(stdout);
}
printf("%.8f sec in average, from quality %f to %f\n",
printf("%.9f sec in average, from quality %f to %f\n",
total_time/iter, original_best, SPR.tetrahedra.quality);
return 0;
......@@ -617,6 +617,72 @@ int main()
HXT_CHECK( benchmark(coord, sizeof(coord)/sizeof(coord[0]), face, sizeof(face)/sizeof(face[0]), best) );
HXT_CHECK( benchmark(coord, sizeof(coord)/sizeof(coord[0]), face, sizeof(face)/sizeof(face[0]), 0.0) );
}
{
// a perfect tetrahedron with a point near a face...
double coord[5][3] = {
{0,0,0},
{1,1,0},
{0,1,1},
{1,0,1},
{0.8,0.8,0.8},
};
unsigned char face[6][3] = {
{0, 1, 2},
{0, 2, 3},
{0, 3, 1},
{1, 3, 4},
{1, 4, 2},
{2, 4, 3}
};
double best = aspectRatio(coord[1], coord[2], coord[3], coord[4], NULL);
printf("\nused for 2-3 flip\n");
HXT_CHECK( benchmark(coord, sizeof(coord)/sizeof(coord[0]), face, sizeof(face)/sizeof(face[0]), best) );
HXT_CHECK( benchmark(coord, sizeof(coord)/sizeof(coord[0]), face, sizeof(face)/sizeof(face[0]), 0.0) );
}
{
// 0-5 form a ccw ring, on z = 0
// 7 is above (toward the viewer) and 6 is below
double coord[8][3] = {
{-0.5, 0, -0.1},
{-0.4, -0.5, 0.1},
{0, -0.8, 0},
{0.5, -0.6, 0},
{0.7, 0, 0.1},
{0, 0.3, -0.1},
{0, -0.2, -1.0},
{0, -0.1, 1.0}
};
unsigned char face[12][3] = {
{0, 1, 6},
{1, 2, 6},
{2, 3, 6},
{3, 4, 6},
{4, 5, 6},
{5, 0, 6},
{0, 7, 1},
{1, 7, 2},
{2, 7, 3},
{3, 7, 4},
{4, 7, 5},
{5, 7, 0},
};
// I don't remember the worst one
double best = 1000.0;
for(int i=0; i<6; i++) {
double qual = aspectRatio(coord[i], coord[(i+1)%6], coord[6], coord[7], NULL);
if(qual < best)
best = qual;
}
printf("\nused for edge removal\n");
HXT_CHECK( benchmark(coord, sizeof(coord)/sizeof(coord[0]), face, sizeof(face)/sizeof(face[0]), best) );
HXT_CHECK( benchmark(coord, sizeof(coord)/sizeof(coord[0]), face, sizeof(face)/sizeof(face[0]), 0.0) );
}
return 0;
}
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment