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