Compare commits

..

2 Commits

Author SHA1 Message Date
3a4c7a6dc9 E3 2024-09-06 16:23:07 +02:00
a7dee833f3 took 2024-09-06 16:22:59 +02:00

View File

@ -46,6 +46,7 @@ int main(int argc, char *argv[]) {
Tour tour;
double x;
double y;
auto timeStart = std::chrono::high_resolution_clock::now();
while (input >> x >> y) {
Point p(x, y);
tour.insertSmallest(p);
@ -56,12 +57,14 @@ int main(int argc, char *argv[]) {
//a.processEvents();
}
input.close();
auto took = std::chrono::high_resolution_clock::now() - timeStart;
// print tour to standard output
cout << "Tour distance: " << std::fixed << std::setprecision(4)
<< std::showpoint << tour.distance() << endl;
cout << "Number of points: " << tour.size() << endl;
tour.show();
cout << "Calculation took: " << took.count()*1E-6 << "ms" << endl;
// draw tour
tour.draw(scene);