Merge branch 'main' of http://git.hexaquo.at/mgs/quickhull into main

This commit is contained in:
karl 2020-12-08 11:59:16 +01:00
commit f2c67df278
2 changed files with 0 additions and 11 deletions

View File

@ -15,8 +15,6 @@ class Quickhull
public: public:
static void get_hull(std::list<Point> &input, std::list<Point> &output, bool akl) static void get_hull(std::list<Point> &input, std::list<Point> &output, bool akl)
{ {
auto start = std::chrono::high_resolution_clock::now();
// Get leftmost and rightmost point // Get leftmost and rightmost point
Point leftmost(INFINITY, 0.0), rightmost(-INFINITY, 0.0); Point leftmost(INFINITY, 0.0), rightmost(-INFINITY, 0.0);
@ -92,9 +90,6 @@ public:
// Call get_hull_with_line with the left points, as well as with the right points, and the line // Call get_hull_with_line with the left points, as well as with the right points, and the line
get_hull_with_line(points_left, output, line); get_hull_with_line(points_left, output, line);
get_hull_with_line(points_right, output, line); get_hull_with_line(points_right, output, line);
auto diff = std::chrono::duration<double, std::milli>(std::chrono::high_resolution_clock::now() - start);
std::cout << "-- inner diff: " << diff.count() << "ms" << std::endl;
} }
static void show (std::list<Point> &points, std::list<Point>& hull) static void show (std::list<Point> &points, std::list<Point>& hull)

View File

@ -84,7 +84,6 @@ int main (int argc, char **argv)
{ {
std::list<Point> hull; std::list<Point> hull;
std::chrono::duration<double, std::milli> total; std::chrono::duration<double, std::milli> total;
auto start2 = std::chrono::high_resolution_clock::now(); // TODO: remove, just for comparison
for (int i = 0; i < runs; ++i) for (int i = 0; i < runs; ++i)
{ {
std::cout << "running quickhull perf mode " << (i + 1) << " of " << runs << "..." << std::endl; std::cout << "running quickhull perf mode " << (i + 1) << " of " << runs << "..." << std::endl;
@ -99,11 +98,6 @@ int main (int argc, char **argv)
} }
else else
{ {
// ---------------------------------------------------------------
// TODO: remove, just for comparison
auto diff2 = std::chrono::duration<double, std::milli>(std::chrono::high_resolution_clock::now() - start2);
std::cout << "total time spent: " << diff2.count() << "ms" << std::endl;
// ---------------------------------------------------------------
std::cout << "average time spent: " << total.count()/runs << "ms" << std::endl; std::cout << "average time spent: " << total.count()/runs << "ms" << std::endl;
Quickhull::show(points, hull); Quickhull::show(points, hull);
} }