Used std::arr<T>.end() instead of adding n to the .begin() iterator

This commit is contained in:
Anirudh Lakhanpal 2025-01-22 19:27:31 +05:30
parent b17854f45b
commit 27c788d1d3
2 changed files with 3 additions and 3 deletions

View File

@ -21,7 +21,7 @@ main( int, char**)
P.at(i) = Point(r.get_double(), r.get_double()); P.at(i) = Point(r.get_double(), r.get_double());
} }
Min_circle mc( P.begin(), P.begin() + n); Min_circle mc( P.begin(), P.end());
Min_circle::Cartesian_const_iterator ccib = mc.center_cartesian_begin(), ccie = mc.center_cartesian_end(); Min_circle::Cartesian_const_iterator ccib = mc.center_cartesian_begin(), ccie = mc.center_cartesian_end();
std::cout << "center:"; std::cout << "center:";

View File

@ -23,8 +23,8 @@ main( int, char**)
// (0,0), (-1,0), (2,0), (-3,0), ... // (0,0), (-1,0), (2,0), (-3,0), ...
} }
Min_circle mc1( P.begin(), P.begin() + n, false); // very slow Min_circle mc1( P.begin(), P.end(), false); // very slow
Min_circle mc2( P.begin(), P.begin() +n, true); // fast Min_circle mc2( P.begin(), P.end(), true); // fast
CGAL::IO::set_pretty_mode( std::cout); CGAL::IO::set_pretty_mode( std::cout);
std::cout << mc2; std::cout << mc2;