summaryrefslogtreecommitdiff
path: root/example/Contraction
diff options
context:
space:
mode:
authorGard Spreemann <gspreemann@gmail.com>2017-10-08 11:15:17 +0200
committerGard Spreemann <gspreemann@gmail.com>2017-10-08 11:15:17 +0200
commit866f6ce614e9c09c97fed12c8c0c2c9fb84fad3f (patch)
tree0c90eb9bab09ccc9785cdf2dc59f0ec861670b85 /example/Contraction
parent8d7329f3e5ad843e553c3c5503cecc28ef2eead6 (diff)
GUDHI 2.0.1 as released by upstream in a tarball.upstream/2.0.1
Diffstat (limited to 'example/Contraction')
-rw-r--r--example/Contraction/CMakeLists.txt7
-rw-r--r--example/Contraction/Garland_heckbert.cpp6
-rw-r--r--example/Contraction/Rips_contraction.cpp7
3 files changed, 10 insertions, 10 deletions
diff --git a/example/Contraction/CMakeLists.txt b/example/Contraction/CMakeLists.txt
index 51a6832d..83594c0e 100644
--- a/example/Contraction/CMakeLists.txt
+++ b/example/Contraction/CMakeLists.txt
@@ -5,10 +5,6 @@ project(Contraction_examples)
add_executable(RipsContraction Rips_contraction.cpp)
add_executable(GarlandHeckbert Garland_heckbert.cpp)
-target_link_libraries(RipsContraction ${Boost_TIMER_LIBRARY} ${Boost_SYSTEM_LIBRARY})
-target_link_libraries(GarlandHeckbert ${Boost_TIMER_LIBRARY} ${Boost_SYSTEM_LIBRARY})
-
-
add_test(NAME Contraction_example_tore3D_0.2 COMMAND $<TARGET_FILE:RipsContraction>
"${CMAKE_SOURCE_DIR}/data/points/tore3D_1307.off" "0.2")
# TODO(DS) : These tests are too long under Windows
@@ -16,3 +12,6 @@ add_test(NAME Contraction_example_tore3D_0.2 COMMAND $<TARGET_FILE:RipsContracti
# "${CMAKE_SOURCE_DIR}/data/points/sphere3D_2646.off" "0.2")
#add_test(NAME Contraction_example_SO3_0.3 COMMAND $<TARGET_FILE:RipsContraction>
# "${CMAKE_SOURCE_DIR}/data/points/SO3_10000.off" "0.3")
+
+install(TARGETS RipsContraction DESTINATION bin)
+install(TARGETS GarlandHeckbert DESTINATION bin)
diff --git a/example/Contraction/Garland_heckbert.cpp b/example/Contraction/Garland_heckbert.cpp
index 8b5a6a6c..f0cde95e 100644
--- a/example/Contraction/Garland_heckbert.cpp
+++ b/example/Contraction/Garland_heckbert.cpp
@@ -29,8 +29,8 @@
#include <gudhi/Edge_contraction.h>
#include <gudhi/Skeleton_blocker.h>
#include <gudhi/Off_reader.h>
+#include <gudhi/Clock.h>
-#include <boost/timer/timer.hpp>
#include <iostream>
#include "Garland_heckbert/Error_quadric.h"
@@ -165,7 +165,7 @@ int main(int argc, char *argv[]) {
int num_contractions = atoi(argv[3]);
- boost::timer::auto_cpu_timer t;
+ Gudhi::Clock contraction_chrono("Time to simplify and enumerate simplices");
// constructs the contractor object with Garland Heckbert policies.
Complex_contractor contractor(complex,
@@ -182,6 +182,8 @@ int main(int argc, char *argv[]) {
complex.num_edges() << " edges and " <<
complex.num_triangles() << " triangles." << std::endl;
+ std::cout << contraction_chrono;
+
// write simplified complex
Gudhi::skeleton_blocker::Skeleton_blocker_off_writer<Complex> off_writer(argv[2], complex);
diff --git a/example/Contraction/Rips_contraction.cpp b/example/Contraction/Rips_contraction.cpp
index 8289b1d3..501b0e87 100644
--- a/example/Contraction/Rips_contraction.cpp
+++ b/example/Contraction/Rips_contraction.cpp
@@ -23,8 +23,8 @@
#include <gudhi/Skeleton_blocker.h>
#include <gudhi/Off_reader.h>
#include <gudhi/Point.h>
+#include <gudhi/Clock.h>
-#include <boost/timer/timer.hpp>
#include <iostream>
struct Geometry_trait {
@@ -68,7 +68,7 @@ int main(int argc, char *argv[]) {
build_rips(complex, atof(argv[2]));
- boost::timer::auto_cpu_timer t;
+ Gudhi::Clock contraction_chrono("Time to simplify and enumerate simplices");
std::cout << "Initial complex has " <<
complex.num_vertices() << " vertices and " <<
@@ -90,8 +90,7 @@ int main(int argc, char *argv[]) {
complex.num_blockers() << " blockers and " <<
num_simplices << " simplices" << std::endl;
-
- std::cout << "Time to simplify and enumerate simplices:\n";
+ std::cout << contraction_chrono;
return EXIT_SUCCESS;
}