Skip to content

Commit

Permalink
Add timing information to test printout
Browse files Browse the repository at this point in the history
  • Loading branch information
JacksonCampolattaro committed Jul 15, 2020
1 parent 53bbfd7 commit 439af83
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions Octree/test/Octree/test_octree_nearest_neighbour.cpp
Expand Up @@ -60,7 +60,9 @@ void naive_vs_octree(std::size_t dataset_size) {
<< "is "
<< "(" << naive_nearest << ") "
<< "at a distance^2 of "
<< CGAL::squared_distance(naive_nearest, random_point)
<< CGAL::squared_distance(naive_nearest, random_point) << " "
<< "with a time of "
<< naive_elapsed_time.count()
<< std::endl;

// Do the same using the octree
Expand All @@ -83,14 +85,16 @@ void naive_vs_octree(std::size_t dataset_size) {
<< "is "
<< "(" << octree_nearest << ") "
<< "at a distance^2 of "
<< CGAL::squared_distance(octree_nearest, random_point)
<< CGAL::squared_distance(octree_nearest, random_point) << " "
<< "with a time of "
<< octree_elapsed_time.count()
<< std::endl;

// Check that they produce the same answer
assert(octree_nearest == naive_nearest);

// Check that the octree was faster
//assert(octree_elapsed_time < naive_elapsed_time);
assert(octree_elapsed_time < naive_elapsed_time);
}

void kdtree_vs_octree(std::size_t dataset_size) {
Expand Down Expand Up @@ -149,9 +153,9 @@ void kdtree_vs_octree(std::size_t dataset_size) {

int main(void) {

naive_vs_octree(100);
naive_vs_octree(1000);
naive_vs_octree(10000);
// naive_vs_octree(100);
// naive_vs_octree(1000);
// naive_vs_octree(10000);
naive_vs_octree(100000);

kdtree_vs_octree(100);
Expand Down

0 comments on commit 439af83

Please sign in to comment.