summaryrefslogtreecommitdiff
path: root/src/Witness_complex
diff options
context:
space:
mode:
Diffstat (limited to 'src/Witness_complex')
-rw-r--r--src/Witness_complex/example/CMakeLists.txt62
-rw-r--r--src/Witness_complex/example/example_nearest_landmark_table.cpp6
-rw-r--r--src/Witness_complex/example/example_witness_complex_sphere.cpp2
-rw-r--r--src/Witness_complex/include/gudhi/Witness_complex.h2
-rw-r--r--src/Witness_complex/test/CMakeLists.txt28
5 files changed, 46 insertions, 54 deletions
diff --git a/src/Witness_complex/example/CMakeLists.txt b/src/Witness_complex/example/CMakeLists.txt
index 9990c541..549a85be 100644
--- a/src/Witness_complex/example/CMakeLists.txt
+++ b/src/Witness_complex/example/CMakeLists.txt
@@ -9,40 +9,36 @@ endif()
add_test(Witness_complex_test_nearest_landmark_table Witness_complex_example_nearest_landmark_table)
# CGAL and Eigen3 are required for Euclidean version of Witness
-if(CGAL_FOUND)
- if (NOT CGAL_VERSION VERSION_LESS 4.6.0)
- if (EIGEN3_FOUND)
- add_executable( Witness_complex_example_off example_witness_complex_off.cpp )
- target_link_libraries(Witness_complex_example_off ${Boost_SYSTEM_LIBRARY})
- add_executable( Witness_complex_example_strong_off example_strong_witness_complex_off.cpp )
- target_link_libraries(Witness_complex_example_strong_off ${Boost_SYSTEM_LIBRARY})
- add_executable ( Witness_complex_example_sphere example_witness_complex_sphere.cpp )
- target_link_libraries(Witness_complex_example_sphere ${Boost_SYSTEM_LIBRARY})
+if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.6.0)
+ add_executable( Witness_complex_example_off example_witness_complex_off.cpp )
+ target_link_libraries(Witness_complex_example_off ${Boost_SYSTEM_LIBRARY})
+ add_executable( Witness_complex_example_strong_off example_strong_witness_complex_off.cpp )
+ target_link_libraries(Witness_complex_example_strong_off ${Boost_SYSTEM_LIBRARY})
+ add_executable ( Witness_complex_example_sphere example_witness_complex_sphere.cpp )
+ target_link_libraries(Witness_complex_example_sphere ${Boost_SYSTEM_LIBRARY})
- add_executable ( Witness_complex_example_witness_persistence example_witness_complex_persistence.cpp )
- target_link_libraries(Witness_complex_example_witness_persistence ${Boost_SYSTEM_LIBRARY} ${Boost_PROGRAM_OPTIONS_LIBRARY})
+ add_executable ( Witness_complex_example_witness_persistence example_witness_complex_persistence.cpp )
+ target_link_libraries(Witness_complex_example_witness_persistence ${Boost_SYSTEM_LIBRARY} ${Boost_PROGRAM_OPTIONS_LIBRARY})
- add_executable ( Witness_complex_example_strong_witness_persistence example_strong_witness_persistence.cpp )
- target_link_libraries(Witness_complex_example_strong_witness_persistence ${Boost_SYSTEM_LIBRARY} ${Boost_PROGRAM_OPTIONS_LIBRARY})
+ add_executable ( Witness_complex_example_strong_witness_persistence example_strong_witness_persistence.cpp )
+ target_link_libraries(Witness_complex_example_strong_witness_persistence ${Boost_SYSTEM_LIBRARY} ${Boost_PROGRAM_OPTIONS_LIBRARY})
- if (TBB_FOUND)
- target_link_libraries(Witness_complex_example_witness_persistence ${TBB_LIBRARIES})
- target_link_libraries(Witness_complex_example_strong_witness_persistence ${TBB_LIBRARIES})
- endif()
+ if (TBB_FOUND)
+ target_link_libraries(Witness_complex_example_witness_persistence ${TBB_LIBRARIES})
+ target_link_libraries(Witness_complex_example_strong_witness_persistence ${TBB_LIBRARIES})
+ endif()
- add_test(Witness_complex_off_test_torus
- ${CMAKE_CURRENT_BINARY_DIR}/Witness_complex_example_off
- ${CMAKE_SOURCE_DIR}/data/points/tore3D_1307.off 20 1.0 3)
- add_test(Witness_complex_strong_off_test_torus
- ${CMAKE_CURRENT_BINARY_DIR}/Witness_complex_example_strong_off
- ${CMAKE_SOURCE_DIR}/data/points/tore3D_1307.off 20 1.0 3)
- add_test(Witness_complex_test_sphere_10 Witness_complex_example_sphere 10)
- add_test(Witness_complex_test_torus_persistence
- ${CMAKE_CURRENT_BINARY_DIR}/Witness_complex_example_witness_persistence
- ${CMAKE_SOURCE_DIR}/data/points/tore3D_1307.off -l 20 -a 0.5)
- add_test(Witness_complex_strong_test_torus_persistence
- ${CMAKE_CURRENT_BINARY_DIR}/Witness_complex_example_strong_witness_persistence
- ${CMAKE_SOURCE_DIR}/data/points/tore3D_1307.off -l 20 -a 0.5)
- endif(EIGEN3_FOUND)
- endif (NOT CGAL_VERSION VERSION_LESS 4.6.0)
-endif()
+ add_test(Witness_complex_off_test_torus
+ ${CMAKE_CURRENT_BINARY_DIR}/Witness_complex_example_off
+ ${CMAKE_SOURCE_DIR}/data/points/tore3D_1307.off 20 1.0 3)
+ add_test(Witness_complex_strong_off_test_torus
+ ${CMAKE_CURRENT_BINARY_DIR}/Witness_complex_example_strong_off
+ ${CMAKE_SOURCE_DIR}/data/points/tore3D_1307.off 20 1.0 3)
+ add_test(Witness_complex_test_sphere_10 Witness_complex_example_sphere 10)
+ add_test(Witness_complex_test_torus_persistence
+ ${CMAKE_CURRENT_BINARY_DIR}/Witness_complex_example_witness_persistence
+ ${CMAKE_SOURCE_DIR}/data/points/tore3D_1307.off -l 20 -a 0.5)
+ add_test(Witness_complex_strong_test_torus_persistence
+ ${CMAKE_CURRENT_BINARY_DIR}/Witness_complex_example_strong_witness_persistence
+ ${CMAKE_SOURCE_DIR}/data/points/tore3D_1307.off -l 20 -a 0.5)
+endif (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.6.0)
diff --git a/src/Witness_complex/example/example_nearest_landmark_table.cpp b/src/Witness_complex/example/example_nearest_landmark_table.cpp
index 7084d416..b8594212 100644
--- a/src/Witness_complex/example/example_nearest_landmark_table.cpp
+++ b/src/Witness_complex/example/example_nearest_landmark_table.cpp
@@ -23,7 +23,7 @@
#define BOOST_PARAMETER_MAX_ARITY 12
#include <gudhi/Simplex_tree.h>
-#include <gudhi/Strong_witness_complex.h>
+#include <gudhi/Witness_complex.h>
#include <gudhi/Persistent_cohomology.h>
#include <iostream>
@@ -35,7 +35,7 @@
int main(int argc, char * const argv[]) {
using Nearest_landmark_range = std::vector<std::pair<std::size_t, double>>;
using Nearest_landmark_table = std::vector<Nearest_landmark_range>;
- using Witness_complex = Gudhi::witness_complex::Strong_witness_complex<Nearest_landmark_table>;
+ using Witness_complex = Gudhi::witness_complex::Witness_complex<Nearest_landmark_table>;
using Simplex_tree = Gudhi::Simplex_tree<>;
using Field_Zp = Gudhi::persistent_cohomology::Field_Zp;
using Persistent_cohomology = Gudhi::persistent_cohomology::Persistent_cohomology<Simplex_tree, Field_Zp>;
@@ -56,7 +56,7 @@ int main(int argc, char * const argv[]) {
std::make_pair(2, 3), std::make_pair(3, 4)}; nlt.push_back(w4);
Witness_complex witness_complex(nlt);
- witness_complex.create_complex(simplex_tree, 4.1, 2);
+ witness_complex.create_complex(simplex_tree, 4.1);
std::cout << "Number of simplices: " << simplex_tree.num_simplices() << std::endl;
diff --git a/src/Witness_complex/example/example_witness_complex_sphere.cpp b/src/Witness_complex/example/example_witness_complex_sphere.cpp
index 06fe3889..124fd99b 100644
--- a/src/Witness_complex/example/example_witness_complex_sphere.cpp
+++ b/src/Witness_complex/example/example_witness_complex_sphere.cpp
@@ -60,12 +60,12 @@ int main(int argc, char * const argv[]) {
}
int number_of_landmarks = atoi(argv[1]);
- clock_t start, end;
std::vector< std::pair<int, double> > l_time;
// Generate points
for (int nbP = 500; nbP < 10000; nbP += 500) {
+ clock_t start, end;
// Construct the Simplex Tree
Gudhi::Simplex_tree<> simplex_tree;
Point_Vector point_vector, landmarks;
diff --git a/src/Witness_complex/include/gudhi/Witness_complex.h b/src/Witness_complex/include/gudhi/Witness_complex.h
index e2791f76..63f03687 100644
--- a/src/Witness_complex/include/gudhi/Witness_complex.h
+++ b/src/Witness_complex/include/gudhi/Witness_complex.h
@@ -178,7 +178,7 @@ class Witness_complex {
norelax_dist2 = l_it->second;
}
} else if (dim == 0) {
- for (;l_it != end && l_it->second - alpha2 <= norelax_dist2; ++l_it) {
+ for (; l_it != end && l_it->second - alpha2 <= norelax_dist2; ++l_it) {
simplex.push_back(l_it->first);
double filtration_value = 0;
// if norelax_dist is infinite, relaxation is 0.
diff --git a/src/Witness_complex/test/CMakeLists.txt b/src/Witness_complex/test/CMakeLists.txt
index 12b3be56..e73f9c3a 100644
--- a/src/Witness_complex/test/CMakeLists.txt
+++ b/src/Witness_complex/test/CMakeLists.txt
@@ -23,20 +23,16 @@ add_test(NAME simple_witness_complex
--log_format=XML --log_sink=${CMAKE_SOURCE_DIR}/Witness_complex_test_simple_witness_complexUT.xml --log_level=test_suite --report_level=no)
# CGAL and Eigen3 are required for Euclidean version of Witness
-if(CGAL_FOUND)
- if (NOT CGAL_VERSION VERSION_LESS 4.6.0)
- if (EIGEN3_FOUND)
- add_executable ( Witness_complex_test_euclidean_simple_witness_complex test_euclidean_simple_witness_complex.cpp )
- target_link_libraries(Witness_complex_test_euclidean_simple_witness_complex ${Boost_SYSTEM_LIBRARY} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
- if (TBB_FOUND)
- target_link_libraries(Witness_complex_test_euclidean_simple_witness_complex ${TBB_LIBRARIES})
- endif(TBB_FOUND)
+if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.6.0)
+ add_executable ( Witness_complex_test_euclidean_simple_witness_complex test_euclidean_simple_witness_complex.cpp )
+ target_link_libraries(Witness_complex_test_euclidean_simple_witness_complex ${Boost_SYSTEM_LIBRARY} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
+ if (TBB_FOUND)
+ target_link_libraries(Witness_complex_test_euclidean_simple_witness_complex ${TBB_LIBRARIES})
+ endif(TBB_FOUND)
- # Unitary tests definition and xml result file generation
- add_test(NAME euclidean_simple_witness_complex
- COMMAND ${CMAKE_CURRENT_BINARY_DIR}/Witness_complex_test_euclidean_simple_witness_complex
- # XML format for Jenkins xUnit plugin
- --log_format=XML --log_sink=${CMAKE_SOURCE_DIR}/Witness_complex_test_euclidean_simple_witness_complexUT.xml --log_level=test_suite --report_level=no)
- endif(EIGEN3_FOUND)
- endif (NOT CGAL_VERSION VERSION_LESS 4.6.0)
-endif()
+ # Unitary tests definition and xml result file generation
+ add_test(NAME euclidean_simple_witness_complex
+ COMMAND ${CMAKE_CURRENT_BINARY_DIR}/Witness_complex_test_euclidean_simple_witness_complex
+ # XML format for Jenkins xUnit plugin
+ --log_format=XML --log_sink=${CMAKE_SOURCE_DIR}/Witness_complex_test_euclidean_simple_witness_complexUT.xml --log_level=test_suite --report_level=no)
+endif (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.6.0)