Skip to content

Commit

Permalink
Fix OrientationIndexStressTest conversion errors
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-jts committed Feb 11, 2025
1 parent 0eef219 commit 188c057
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions benchmarks/algorithm/OrientationIndexStressTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,22 +124,22 @@ bool isConsistent(std::string tag, Coordinate p0, Coordinate p1, Coordinate p2,
bool isConsistentDD(Coordinate p0, Coordinate p1, Coordinate p2)
{
return isConsistent("DD", p0, p1, p2,
[](Coordinate p0, Coordinate p1, Coordinate p2) -> int {
return Orientation::index(p0, p1, p2);
[](Coordinate pt0, Coordinate pt1, Coordinate pt2) -> int {
return Orientation::index(pt0, pt1, pt2);
});
}

bool isConsistentFP(Coordinate p0, Coordinate p1, Coordinate p2)
{
return isConsistent("FP", p0, p1, p2,
[](Coordinate p0, Coordinate p1, Coordinate p2) -> int {
return orientationIndexFP(p0, p1, p2);
[](Coordinate pt0, Coordinate pt1, Coordinate pt2) -> int {
return orientationIndexFP(pt0, pt1, pt2);
});
}

Coordinate randomCoord() {
double x = (10.0 * random()) / RAND_MAX;
double y = (10.0 * random()) / RAND_MAX;
double x = (10.0 * (double) random()) / RAND_MAX;
double y = (10.0 * (double) random()) / RAND_MAX;
return Coordinate(x, y);
}

Expand All @@ -162,8 +162,8 @@ void checkTest(Coordinate p0, Coordinate p1, Coordinate p2)

void reportStats(std::string tag = "") {
std::cout << tag << "Num tests: " << count
<< " DD fail = " << failDD << " (" << round((100.0 * failDD / (double) count)) << "%)"
<< " FP fail = " << failFP << " (" << round((100.0 * failFP / (double) count)) << "%)"
<< " DD fail = " << failDD << " (" << round((100.0 * (double) failDD / (double) count)) << "%)"
<< " FP fail = " << failFP << " (" << round((100.0 * (double) failFP / (double) count)) << "%)"
<< std::endl;
}

Expand Down

0 comments on commit 188c057

Please sign in to comment.