From 004dac98fde448065a1697ea696a67153ccdb77e Mon Sep 17 00:00:00 2001 From: vrouvrea Date: Wed, 30 Nov 2016 21:39:44 +0000 Subject: Add tan_test for test purpose git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/tangential_test@1807 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 85200e0b013cc119aead9556e97db877b3421064 --- src/Tangential_complex/example/CMakeLists.txt | 6 +++ src/Tangential_complex/example/tan_test.cpp | 54 ++++++++++++++++++++++ .../include/gudhi/Tangential_complex/config.h | 3 +- 3 files changed, 61 insertions(+), 2 deletions(-) create mode 100644 src/Tangential_complex/example/tan_test.cpp (limited to 'src/Tangential_complex') diff --git a/src/Tangential_complex/example/CMakeLists.txt b/src/Tangential_complex/example/CMakeLists.txt index a75ccd5b..76ba0a32 100644 --- a/src/Tangential_complex/example/CMakeLists.txt +++ b/src/Tangential_complex/example/CMakeLists.txt @@ -8,9 +8,12 @@ if(CGAL_FOUND) target_link_libraries(Tangential_complex_example_basic ${CGAL_LIBRARY} ${Boost_DATE_TIME_LIBRARY}) add_executable( Tangential_complex_example_with_perturb example_with_perturb.cpp ) target_link_libraries(Tangential_complex_example_with_perturb ${CGAL_LIBRARY} ${Boost_DATE_TIME_LIBRARY}) + add_executable( tan_test tan_test.cpp ) + target_link_libraries(tan_test ${CGAL_LIBRARY} ${Boost_DATE_TIME_LIBRARY}) if (TBB_FOUND) target_link_libraries(Tangential_complex_example_basic ${TBB_LIBRARIES}) target_link_libraries(Tangential_complex_example_with_perturb ${TBB_LIBRARIES}) + target_link_libraries(tan_test ${TBB_LIBRARIES}) endif(TBB_FOUND) add_test(Tangential_complex_example_basic @@ -18,6 +21,9 @@ if(CGAL_FOUND) add_test(Tangential_complex_example_with_perturb ${CMAKE_CURRENT_BINARY_DIR}/Tangential_complex_example_with_perturb) + + add_test(tan_test + ${CMAKE_CURRENT_BINARY_DIR}/tan_test) endif(EIGEN3_FOUND) endif(NOT CGAL_VERSION VERSION_LESS 4.8.0) endif(CGAL_FOUND) diff --git a/src/Tangential_complex/example/tan_test.cpp b/src/Tangential_complex/example/tan_test.cpp new file mode 100644 index 00000000..afb9f13c --- /dev/null +++ b/src/Tangential_complex/example/tan_test.cpp @@ -0,0 +1,54 @@ +#include +#include + +#include +#include + +#include +#include + +namespace tc = Gudhi::tangential_complex; + +typedef CGAL::Epick_d Kernel; +typedef Kernel::FT FT; +typedef Kernel::Point_d Point; +typedef Kernel::Vector_d Vector; +typedef tc::Tangential_complex< +Kernel, CGAL::Dynamic_dimension_tag, +CGAL::Parallel_tag> TC; + +int main(void) { + const int INTRINSIC_DIM = 1; + + // Generate points on a 2-sphere + std::vector points; + // [[0, 0], [1, 0], [0, 1], [1, 1]] + std::vector point = {0.0, 0.0}; + points.push_back(Point(point.size(), point.begin(), point.end())); + point = {1.0, 0.0}; + points.push_back(Point(point.size(), point.begin(), point.end())); + point = {0.0, 1.0}; + points.push_back(Point(point.size(), point.begin(), point.end())); + point = {1.0, 1.0}; + points.push_back(Point(point.size(), point.begin(), point.end())); + + Kernel k; + for (int i = 0; i < 100; i++) { + + // Compute the TC + TC tc(points, INTRINSIC_DIM, k); + tc.compute_tangential_complex(); + TC::Num_inconsistencies num_inc = tc.number_of_inconsistent_simplices(); + std::cout << "TC vertices = " << tc.number_of_vertices() << " - simplices = " << num_inc.num_simplices << + " - inconsistencies = " << num_inc.num_inconsistent_simplices << std::endl; + + tc.fix_inconsistencies_using_perturbation(10.0, 60.0); + // Export the TC into a Simplex_tree + Gudhi::Simplex_tree<> stree; + tc.create_complex(stree); + std::cout << "ST vertices = " << stree.num_vertices() << " - simplices = " << stree.num_simplices() << std::endl; + + } + + return 0; +} diff --git a/src/Tangential_complex/include/gudhi/Tangential_complex/config.h b/src/Tangential_complex/include/gudhi/Tangential_complex/config.h index 98a1b14f..ffefcd6b 100644 --- a/src/Tangential_complex/include/gudhi/Tangential_complex/config.h +++ b/src/Tangential_complex/include/gudhi/Tangential_complex/config.h @@ -26,8 +26,7 @@ #include // ========================= Debugging & profiling ============================= -#define GUDHI_TC_PROFILING -#define DEBUG_TRACES +// #define GUDHI_TC_PROFILING // #define GUDHI_TC_VERY_VERBOSE // #define GUDHI_TC_PERFORM_EXTRA_CHECKS // #define GUDHI_TC_SHOW_DETAILED_STATS_FOR_INCONSISTENCIES -- cgit v1.2.3 From 12fa1bbb902bebb2ffc21482a25913ac7c49dc85 Mon Sep 17 00:00:00 2001 From: vrouvrea Date: Mon, 12 Dec 2016 10:04:42 +0000 Subject: Fix the bug, remove tan_test from examples and add a unitary test git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/tangential_test@1850 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 852570382d6f5713e534b49e7abf1e96a4a84076 --- CMakeLists.txt | 14 +++--- src/Tangential_complex/example/CMakeLists.txt | 5 -- src/Tangential_complex/example/tan_test.cpp | 54 -------------------- .../include/gudhi/Tangential_complex.h | 8 ++- .../test/test_tangential_complex.cpp | 57 ++++++++++++++++++++++ 5 files changed, 70 insertions(+), 68 deletions(-) delete mode 100644 src/Tangential_complex/example/tan_test.cpp (limited to 'src/Tangential_complex') diff --git a/CMakeLists.txt b/CMakeLists.txt index 005df6d7..78de6c09 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -73,13 +73,13 @@ else() set(Boost_USE_STATIC_RUNTIME OFF) # Find TBB package for parallel sort - not mandatory, just optional. - set(TBB_FIND_QUIETLY ON) - find_package(TBB) - if (TBB_FOUND) - include(${TBB_USE_FILE}) - message("TBB found in ${TBB_LIBRARY_DIRS}") - add_definitions(-DGUDHI_USE_TBB) - endif() + #set(TBB_FIND_QUIETLY ON) + #find_package(TBB) + #if (TBB_FOUND) + # include(${TBB_USE_FILE}) + # message("TBB found in ${TBB_LIBRARY_DIRS}") + # add_definitions(-DGUDHI_USE_TBB) + #endif() find_package(Eigen3 3.1.0) if (EIGEN3_FOUND) diff --git a/src/Tangential_complex/example/CMakeLists.txt b/src/Tangential_complex/example/CMakeLists.txt index 76ba0a32..32f6eebb 100644 --- a/src/Tangential_complex/example/CMakeLists.txt +++ b/src/Tangential_complex/example/CMakeLists.txt @@ -8,12 +8,9 @@ if(CGAL_FOUND) target_link_libraries(Tangential_complex_example_basic ${CGAL_LIBRARY} ${Boost_DATE_TIME_LIBRARY}) add_executable( Tangential_complex_example_with_perturb example_with_perturb.cpp ) target_link_libraries(Tangential_complex_example_with_perturb ${CGAL_LIBRARY} ${Boost_DATE_TIME_LIBRARY}) - add_executable( tan_test tan_test.cpp ) - target_link_libraries(tan_test ${CGAL_LIBRARY} ${Boost_DATE_TIME_LIBRARY}) if (TBB_FOUND) target_link_libraries(Tangential_complex_example_basic ${TBB_LIBRARIES}) target_link_libraries(Tangential_complex_example_with_perturb ${TBB_LIBRARIES}) - target_link_libraries(tan_test ${TBB_LIBRARIES}) endif(TBB_FOUND) add_test(Tangential_complex_example_basic @@ -22,8 +19,6 @@ if(CGAL_FOUND) add_test(Tangential_complex_example_with_perturb ${CMAKE_CURRENT_BINARY_DIR}/Tangential_complex_example_with_perturb) - add_test(tan_test - ${CMAKE_CURRENT_BINARY_DIR}/tan_test) endif(EIGEN3_FOUND) endif(NOT CGAL_VERSION VERSION_LESS 4.8.0) endif(CGAL_FOUND) diff --git a/src/Tangential_complex/example/tan_test.cpp b/src/Tangential_complex/example/tan_test.cpp deleted file mode 100644 index afb9f13c..00000000 --- a/src/Tangential_complex/example/tan_test.cpp +++ /dev/null @@ -1,54 +0,0 @@ -#include -#include - -#include -#include - -#include -#include - -namespace tc = Gudhi::tangential_complex; - -typedef CGAL::Epick_d Kernel; -typedef Kernel::FT FT; -typedef Kernel::Point_d Point; -typedef Kernel::Vector_d Vector; -typedef tc::Tangential_complex< -Kernel, CGAL::Dynamic_dimension_tag, -CGAL::Parallel_tag> TC; - -int main(void) { - const int INTRINSIC_DIM = 1; - - // Generate points on a 2-sphere - std::vector points; - // [[0, 0], [1, 0], [0, 1], [1, 1]] - std::vector point = {0.0, 0.0}; - points.push_back(Point(point.size(), point.begin(), point.end())); - point = {1.0, 0.0}; - points.push_back(Point(point.size(), point.begin(), point.end())); - point = {0.0, 1.0}; - points.push_back(Point(point.size(), point.begin(), point.end())); - point = {1.0, 1.0}; - points.push_back(Point(point.size(), point.begin(), point.end())); - - Kernel k; - for (int i = 0; i < 100; i++) { - - // Compute the TC - TC tc(points, INTRINSIC_DIM, k); - tc.compute_tangential_complex(); - TC::Num_inconsistencies num_inc = tc.number_of_inconsistent_simplices(); - std::cout << "TC vertices = " << tc.number_of_vertices() << " - simplices = " << num_inc.num_simplices << - " - inconsistencies = " << num_inc.num_inconsistent_simplices << std::endl; - - tc.fix_inconsistencies_using_perturbation(10.0, 60.0); - // Export the TC into a Simplex_tree - Gudhi::Simplex_tree<> stree; - tc.create_complex(stree); - std::cout << "ST vertices = " << stree.num_vertices() << " - simplices = " << stree.num_simplices() << std::endl; - - } - - return 0; -} diff --git a/src/Tangential_complex/include/gudhi/Tangential_complex.h b/src/Tangential_complex/include/gudhi/Tangential_complex.h index e748d3b7..90c164e2 100644 --- a/src/Tangential_complex/include/gudhi/Tangential_complex.h +++ b/src/Tangential_complex/include/gudhi/Tangential_complex.h @@ -1303,7 +1303,9 @@ class Tangential_complex { , bool normalize_basis = true , Orthogonal_space_basis *p_orth_space_basis = NULL ) { - unsigned int num_pts_for_pca = static_cast (std::pow(GUDHI_TC_BASE_VALUE_FOR_PCA, m_intrinsic_dim)); +// unsigned int num_pts_for_pca = static_cast (std::pow(GUDHI_TC_BASE_VALUE_FOR_PCA, m_intrinsic_dim)); + unsigned int num_pts_for_pca = (std::min)(static_cast (std::pow(GUDHI_TC_BASE_VALUE_FOR_PCA, m_intrinsic_dim)), + static_cast (m_points.size())); // Kernel functors typename K::Construct_vector_d constr_vec = @@ -1392,7 +1394,9 @@ class Tangential_complex { // on it. Note that most points are duplicated. Tangent_space_basis compute_tangent_space(const Simplex &s, bool normalize_basis = true) { - unsigned int num_pts_for_pca = static_cast (std::pow(GUDHI_TC_BASE_VALUE_FOR_PCA, m_intrinsic_dim)); +// unsigned int num_pts_for_pca = static_cast (std::pow(GUDHI_TC_BASE_VALUE_FOR_PCA, m_intrinsic_dim)); + unsigned int num_pts_for_pca = (std::min)(static_cast (std::pow(GUDHI_TC_BASE_VALUE_FOR_PCA, m_intrinsic_dim)), + static_cast (m_points.size())); // Kernel functors typename K::Construct_vector_d constr_vec = diff --git a/src/Tangential_complex/test/test_tangential_complex.cpp b/src/Tangential_complex/test/test_tangential_complex.cpp index f8b0d2fb..4c3dec3b 100644 --- a/src/Tangential_complex/test/test_tangential_complex.cpp +++ b/src/Tangential_complex/test/test_tangential_complex.cpp @@ -68,3 +68,60 @@ BOOST_AUTO_TEST_CASE(test_Spatial_tree_data_structure) { Gudhi::Simplex_tree<> stree; tc.create_complex(stree); } + +BOOST_AUTO_TEST_CASE(test_mini_tangential) { + typedef CGAL::Epick_d Kernel; + typedef Kernel::FT FT; + typedef Kernel::Point_d Point; + typedef Kernel::Vector_d Vector; + typedef tc::Tangential_complex TC; + + + const int INTRINSIC_DIM = 1; + + // Generate points on a 2-sphere + std::vector points; + // [[0, 0], [1, 0], [0, 1], [1, 1]] + std::vector point = {0.0, 0.0}; + points.push_back(Point(point.size(), point.begin(), point.end())); + point = {1.0, 0.0}; + points.push_back(Point(point.size(), point.begin(), point.end())); + point = {0.0, 1.0}; + points.push_back(Point(point.size(), point.begin(), point.end())); + point = {1.0, 1.0}; + points.push_back(Point(point.size(), point.begin(), point.end())); + std::cout << "points = " << points.size() << std::endl; + Kernel k; + + // Compute the TC + TC tc(points, INTRINSIC_DIM, k); + tc.compute_tangential_complex(); + TC::Num_inconsistencies num_inc = tc.number_of_inconsistent_simplices(); + std::cout << "TC vertices = " << tc.number_of_vertices() << " - simplices = " << num_inc.num_simplices << + " - inconsistencies = " << num_inc.num_inconsistent_simplices << std::endl; + + BOOST_CHECK(tc.number_of_vertices() == 4); + BOOST_CHECK(num_inc.num_simplices == 4); + BOOST_CHECK(num_inc.num_inconsistent_simplices == 2); + + // Export the TC into a Simplex_tree + Gudhi::Simplex_tree<> stree; + tc.create_complex(stree); + std::cout << "ST vertices = " << stree.num_vertices() << " - simplices = " << stree.num_simplices() << std::endl; + + BOOST_CHECK(stree.num_vertices() == 4); + BOOST_CHECK(stree.num_simplices() == 12); + + tc.fix_inconsistencies_using_perturbation(0.01, 30.0); + + BOOST_CHECK(tc.number_of_vertices() == 4); + BOOST_CHECK(num_inc.num_simplices == 4); + BOOST_CHECK(num_inc.num_inconsistent_simplices == 2); + + // Export the TC into a Simplex_tree + tc.create_complex(stree); + std::cout << "ST vertices = " << stree.num_vertices() << " - simplices = " << stree.num_simplices() << std::endl; + + BOOST_CHECK(stree.num_vertices() == 4); + BOOST_CHECK(stree.num_simplices() == 12); +} -- cgit v1.2.3 From 09150bdb2d0b7f55fd6014ca5fbd63fd002fafc9 Mon Sep 17 00:00:00 2001 From: vrouvrea Date: Mon, 12 Dec 2016 12:53:14 +0000 Subject: Fix max issue and remove (&tr == NULL) test git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/tangential_test@1852 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 932aa53773092c64f1d69ce0d4c0fdaf817b5b06 --- src/Tangential_complex/include/gudhi/Tangential_complex.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/Tangential_complex') diff --git a/src/Tangential_complex/include/gudhi/Tangential_complex.h b/src/Tangential_complex/include/gudhi/Tangential_complex.h index 90c164e2..c9317a44 100644 --- a/src/Tangential_complex/include/gudhi/Tangential_complex.h +++ b/src/Tangential_complex/include/gudhi/Tangential_complex.h @@ -63,6 +63,7 @@ #include #include // for std::sqrt #include +#include // for std::size_t #ifdef GUDHI_USE_TBB #include @@ -82,7 +83,7 @@ using namespace internal; class Vertex_data { public: - Vertex_data(std::size_t data = std::numeric_limits::max()) + Vertex_data(std::size_t data = (std::numeric_limits::max)()) : m_data(data) { } operator std::size_t() { @@ -1048,7 +1049,7 @@ class Tangential_complex { #endif // GUDHI_USE_TBB bool is_infinite(Simplex const& s) const { - return *s.rbegin() == std::numeric_limits::max(); + return *s.rbegin() == (std::numeric_limits::max)(); } // Output: "triangulation" is a Regular Triangulation containing at least the @@ -1654,7 +1655,7 @@ class Tangential_complex { for (; it_point_idx != simplex.end(); ++it_point_idx) { std::size_t point_idx = *it_point_idx; // Don't check infinite simplices - if (point_idx == std::numeric_limits::max()) + if (point_idx == (std::numeric_limits::max)()) continue; Star const& star = m_stars[point_idx]; @@ -1693,7 +1694,7 @@ class Tangential_complex { for (; it_point_idx != s.end(); ++it_point_idx) { std::size_t point_idx = *it_point_idx; // Don't check infinite simplices - if (point_idx == std::numeric_limits::max()) + if (point_idx == (std::numeric_limits::max)()) continue; Star const& star = m_stars[point_idx]; @@ -1959,7 +1960,7 @@ class Tangential_complex { Triangulation const& tr = it_tr->tr(); Tr_vertex_handle center_vh = it_tr->center_vertex(); - if (&tr == NULL || tr.current_dimension() < m_intrinsic_dim) + if (tr.current_dimension() < m_intrinsic_dim) continue; // Color for this star -- cgit v1.2.3 From 454558fecf99cee350eb7d3f81a149c647805c16 Mon Sep 17 00:00:00 2001 From: vrouvrea Date: Mon, 12 Dec 2016 13:08:22 +0000 Subject: Use (std::numeric_limits::max) to fix Windows global min max git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/tangential_test@1853 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 970c2190f89a6f11712edc07c1980ce0cbdb486b --- src/Tangential_complex/benchmark/benchmark_tc.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Tangential_complex') diff --git a/src/Tangential_complex/benchmark/benchmark_tc.cpp b/src/Tangential_complex/benchmark/benchmark_tc.cpp index 943fcb54..6d6dd548 100644 --- a/src/Tangential_complex/benchmark/benchmark_tc.cpp +++ b/src/Tangential_complex/benchmark/benchmark_tc.cpp @@ -161,7 +161,7 @@ typename Kernel, typename OutputIteratorPoints> bool load_points_from_file( const std::string &filename, OutputIteratorPoints points, - std::size_t only_first_n_points = std::numeric_limits::max()) { + std::size_t only_first_n_points = (std::numeric_limits::max)()) { typedef typename Kernel::Point_d Point; std::ifstream in(filename); @@ -196,7 +196,7 @@ bool load_points_and_tangent_space_basis_from_file( OutputIteratorPoints points, OutputIteratorTS tangent_spaces, int intrinsic_dim, - std::size_t only_first_n_points = std::numeric_limits::max()) { + std::size_t only_first_n_points = (std::numeric_limits::max)()) { typedef typename Kernel::Point_d Point; typedef typename Kernel::Vector_d Vector; -- cgit v1.2.3 From 8c1fdb043e58e6d5006d51c46cdf54b5de4613e7 Mon Sep 17 00:00:00 2001 From: vrouvrea Date: Mon, 12 Dec 2016 13:28:57 +0000 Subject: parenthesis for std::min because of Windows min global function git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/tangential_test@1854 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 4540b7f111515cbe8e9e53c78fc00111533306f1 --- src/Tangential_complex/include/gudhi/Tangential_complex.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Tangential_complex') diff --git a/src/Tangential_complex/include/gudhi/Tangential_complex.h b/src/Tangential_complex/include/gudhi/Tangential_complex.h index c9317a44..2d185a90 100644 --- a/src/Tangential_complex/include/gudhi/Tangential_complex.h +++ b/src/Tangential_complex/include/gudhi/Tangential_complex.h @@ -1905,7 +1905,7 @@ class Tangential_complex { #ifdef GUDHI_TC_EXPORT_ALL_COORDS_IN_OFF int num_coords = m_ambient_dim; #else - int num_coords = std::min(m_ambient_dim, 3); + int num_coords = (std::min)(m_ambient_dim, 3); #endif #ifdef GUDHI_TC_EXPORT_NORMALS -- cgit v1.2.3 From da92ae2f10d715b801f55f8f651fea8a4979f263 Mon Sep 17 00:00:00 2001 From: vrouvrea Date: Tue, 13 Dec 2016 10:28:07 +0000 Subject: Add example just for Mac test. To be removed. git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/tangential_test@1861 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: be598143de42dba782462985515cbc77b0a51e8b --- src/Tangential_complex/example/CMakeLists.txt | 3 ++ src/Tangential_complex/example/example.cpp | 78 +++++++++++++++++++++++++++ 2 files changed, 81 insertions(+) create mode 100644 src/Tangential_complex/example/example.cpp (limited to 'src/Tangential_complex') diff --git a/src/Tangential_complex/example/CMakeLists.txt b/src/Tangential_complex/example/CMakeLists.txt index 32f6eebb..291432b0 100644 --- a/src/Tangential_complex/example/CMakeLists.txt +++ b/src/Tangential_complex/example/CMakeLists.txt @@ -8,9 +8,12 @@ if(CGAL_FOUND) target_link_libraries(Tangential_complex_example_basic ${CGAL_LIBRARY} ${Boost_DATE_TIME_LIBRARY}) add_executable( Tangential_complex_example_with_perturb example_with_perturb.cpp ) target_link_libraries(Tangential_complex_example_with_perturb ${CGAL_LIBRARY} ${Boost_DATE_TIME_LIBRARY}) + add_executable( example example.cpp ) + target_link_libraries(example ${CGAL_LIBRARY} ${Boost_DATE_TIME_LIBRARY}) if (TBB_FOUND) target_link_libraries(Tangential_complex_example_basic ${TBB_LIBRARIES}) target_link_libraries(Tangential_complex_example_with_perturb ${TBB_LIBRARIES}) + target_link_libraries(example ${TBB_LIBRARIES}) endif(TBB_FOUND) add_test(Tangential_complex_example_basic diff --git a/src/Tangential_complex/example/example.cpp b/src/Tangential_complex/example/example.cpp new file mode 100644 index 00000000..cd0f121f --- /dev/null +++ b/src/Tangential_complex/example/example.cpp @@ -0,0 +1,78 @@ +#include +#include + +#include +#include + +#include +#include + +namespace tc = Gudhi::tangential_complex; + + +int main(void) { + typedef CGAL::Epick_d Kernel; + typedef Kernel::FT FT; + typedef Kernel::Point_d Point; + typedef Kernel::Vector_d Vector; + typedef tc::Tangential_complex TC; + + + const int INTRINSIC_DIM = 1; + + // Generate points on a 2-sphere + std::vector points; + // [[0, 0], [1, 0], [0, 1], [1, 1]] + std::vector point = {0.0, 0.0}; + points.push_back(Point(point.size(), point.begin(), point.end())); + point = {1.0, 0.0}; + points.push_back(Point(point.size(), point.begin(), point.end())); + point = {0.0, 1.0}; + points.push_back(Point(point.size(), point.begin(), point.end())); + point = {1.0, 1.0}; + points.push_back(Point(point.size(), point.begin(), point.end())); + std::cout << "points = " << points.size() << std::endl; + Kernel k; + + // Compute the TC + TC tc(points, INTRINSIC_DIM, k); + tc.compute_tangential_complex(); + TC::Num_inconsistencies num_inc = tc.number_of_inconsistent_simplices(); + std::cout << "TC vertices = " << tc.number_of_vertices() << " - simplices = " << num_inc.num_simplices << + " - inconsistencies = " << num_inc.num_inconsistent_simplices << std::endl; + + // Export the TC into a Simplex_tree + Gudhi::Simplex_tree<> stree; + tc.create_complex(stree); + + std::cout << "********************************************************************\n"; + std::cout << "* The complex contains " << stree.num_simplices() << " simplices"; + std::cout << " - dimension " << stree.dimension() << " - filtration " << stree.filtration() << "\n"; + std::cout << "* Iterator on Simplices in the filtration, with [filtration value]:\n"; + for (auto f_simplex : stree.filtration_simplex_range()) { + std::cout << " " << "[" << stree.filtration(f_simplex) << "] "; + for (auto vertex : stree.simplex_vertex_range(f_simplex)) { + std::cout << static_cast(vertex) << " "; + } + std::cout << std::endl; + } + + tc.fix_inconsistencies_using_perturbation(0.01, 30.0); + + // Export the TC into a Simplex_tree + tc.create_complex(stree); + + std::cout << "********************************************************************\n"; + std::cout << "* The complex contains " << stree.num_simplices() << " simplices\n"; + std::cout << " - dimension " << stree.dimension() << " - filtration " << stree.filtration() << "\n"; + std::cout << "* Iterator on Simplices in the filtration, with [filtration value]:\n"; + for (auto f_simplex : stree.filtration_simplex_range()) { + std::cout << " " << "[" << stree.filtration(f_simplex) << "] "; + for (auto vertex : stree.simplex_vertex_range(f_simplex)) { + std::cout << static_cast(vertex) << " "; + } + std::cout << std::endl; + } + + return 0; +} -- cgit v1.2.3 From 0c277327bb7fbbc096825ed817458440930cca33 Mon Sep 17 00:00:00 2001 From: vrouvrea Date: Tue, 13 Dec 2016 11:53:31 +0000 Subject: Example modification git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/tangential_test@1863 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 0706eed9656c214bbabfa9a8da2f800c2afdf140 --- src/Tangential_complex/example/example.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/Tangential_complex') diff --git a/src/Tangential_complex/example/example.cpp b/src/Tangential_complex/example/example.cpp index cd0f121f..fa25ac53 100644 --- a/src/Tangential_complex/example/example.cpp +++ b/src/Tangential_complex/example/example.cpp @@ -43,7 +43,9 @@ int main(void) { // Export the TC into a Simplex_tree Gudhi::Simplex_tree<> stree; - tc.create_complex(stree); + int max_dim = tc.create_complex(stree); + stree.set_dimension(max_dim); + stree.initialize_filtration(); std::cout << "********************************************************************\n"; std::cout << "* The complex contains " << stree.num_simplices() << " simplices"; @@ -60,7 +62,9 @@ int main(void) { tc.fix_inconsistencies_using_perturbation(0.01, 30.0); // Export the TC into a Simplex_tree - tc.create_complex(stree); + max_dim = tc.create_complex(stree); + stree.set_dimension(max_dim); + stree.initialize_filtration(); std::cout << "********************************************************************\n"; std::cout << "* The complex contains " << stree.num_simplices() << " simplices\n"; -- cgit v1.2.3 From 1860c2f5e93b789fa14095668dc0b62d94dddfa5 Mon Sep 17 00:00:00 2001 From: vrouvrea Date: Tue, 13 Dec 2016 12:36:20 +0000 Subject: example point display git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/tangential_test@1864 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 1a97b8a9c1f7aff6cdeae8a2fa0eef911f4a5596 --- src/Tangential_complex/example/example.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/Tangential_complex') diff --git a/src/Tangential_complex/example/example.cpp b/src/Tangential_complex/example/example.cpp index fa25ac53..f740cb1c 100644 --- a/src/Tangential_complex/example/example.cpp +++ b/src/Tangential_complex/example/example.cpp @@ -41,6 +41,9 @@ int main(void) { std::cout << "TC vertices = " << tc.number_of_vertices() << " - simplices = " << num_inc.num_simplices << " - inconsistencies = " << num_inc.num_inconsistent_simplices << std::endl; + std::cout << "TC point[0] " << tc.get_point(0) << " - point[1] " << tc.get_point(1) << + " - point[2] " << tc.get_point(2) << " - point[3] " << tc.get_point(3) << std::endl; + // Export the TC into a Simplex_tree Gudhi::Simplex_tree<> stree; int max_dim = tc.create_complex(stree); @@ -67,7 +70,7 @@ int main(void) { stree.initialize_filtration(); std::cout << "********************************************************************\n"; - std::cout << "* The complex contains " << stree.num_simplices() << " simplices\n"; + std::cout << "* The complex contains " << stree.num_simplices() << " simplices"; std::cout << " - dimension " << stree.dimension() << " - filtration " << stree.filtration() << "\n"; std::cout << "* Iterator on Simplices in the filtration, with [filtration value]:\n"; for (auto f_simplex : stree.filtration_simplex_range()) { -- cgit v1.2.3 From 5703e63889f239e11a6688cda43011cb27282d99 Mon Sep 17 00:00:00 2001 From: vrouvrea Date: Wed, 14 Dec 2016 15:24:13 +0000 Subject: example modif git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/tangential_test@1870 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 43cf0d0b91808445614a3dc3d51ee87679c1a5d1 --- src/Tangential_complex/example/example.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Tangential_complex') diff --git a/src/Tangential_complex/example/example.cpp b/src/Tangential_complex/example/example.cpp index f740cb1c..a503091c 100644 --- a/src/Tangential_complex/example/example.cpp +++ b/src/Tangential_complex/example/example.cpp @@ -39,7 +39,7 @@ int main(void) { tc.compute_tangential_complex(); TC::Num_inconsistencies num_inc = tc.number_of_inconsistent_simplices(); std::cout << "TC vertices = " << tc.number_of_vertices() << " - simplices = " << num_inc.num_simplices << - " - inconsistencies = " << num_inc.num_inconsistent_simplices << std::endl; + " - inc simplices = " << num_inc.num_inconsistent_simplices << " - inc stars = " << num_inc.num_inconsistent_stars << std::endl; std::cout << "TC point[0] " << tc.get_point(0) << " - point[1] " << tc.get_point(1) << " - point[2] " << tc.get_point(2) << " - point[3] " << tc.get_point(3) << std::endl; -- cgit v1.2.3 From 42e91253237a19af47c9a721a7f119dccc89113a Mon Sep 17 00:00:00 2001 From: vrouvrea Date: Wed, 14 Dec 2016 15:46:39 +0000 Subject: Add traces git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/tangential_test@1871 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: b37d7be6b0f2ecc5217180e7ce3b14ab338c2354 --- src/Tangential_complex/include/gudhi/Tangential_complex.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/Tangential_complex') diff --git a/src/Tangential_complex/include/gudhi/Tangential_complex.h b/src/Tangential_complex/include/gudhi/Tangential_complex.h index 2d185a90..fc368a5d 100644 --- a/src/Tangential_complex/include/gudhi/Tangential_complex.h +++ b/src/Tangential_complex/include/gudhi/Tangential_complex.h @@ -1364,6 +1364,11 @@ class Tangential_complex { eig.eigenvectors().col(j).data() + m_ambient_dim)); } } + for (auto v : tsb) { + for (int i = 0; i < 2; ++i) + std::cerr << coord(v, i) << ", "; + std::cerr << "\n"; + } if (p_orth_space_basis) { p_orth_space_basis->set_origin(i); -- cgit v1.2.3 From b1e6e79715f68498c04a88e7d2237ec478078d11 Mon Sep 17 00:00:00 2001 From: vrouvrea Date: Wed, 14 Dec 2016 16:00:37 +0000 Subject: Points perturb git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/tangential_test@1872 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: f194dac5b999169fdf29fbb9223f0ee9db9c12ba --- src/Tangential_complex/example/example.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Tangential_complex') diff --git a/src/Tangential_complex/example/example.cpp b/src/Tangential_complex/example/example.cpp index a503091c..b7eb542b 100644 --- a/src/Tangential_complex/example/example.cpp +++ b/src/Tangential_complex/example/example.cpp @@ -25,9 +25,9 @@ int main(void) { // [[0, 0], [1, 0], [0, 1], [1, 1]] std::vector point = {0.0, 0.0}; points.push_back(Point(point.size(), point.begin(), point.end())); - point = {1.0, 0.0}; + point = {1.1, 0.0}; points.push_back(Point(point.size(), point.begin(), point.end())); - point = {0.0, 1.0}; + point = {0.2, 1.3}; points.push_back(Point(point.size(), point.begin(), point.end())); point = {1.0, 1.0}; points.push_back(Point(point.size(), point.begin(), point.end())); -- cgit v1.2.3 From 28b7623d0aed90abe58260861c85b20e43227216 Mon Sep 17 00:00:00 2001 From: cjamin Date: Wed, 14 Dec 2016 18:02:15 +0000 Subject: Bug fix for degenerate cases git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/tangential_test@1873 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: a292246c5e85275ec8bbf293fa0157d6693121cf --- src/Tangential_complex/include/gudhi/Tangential_complex.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/Tangential_complex') diff --git a/src/Tangential_complex/include/gudhi/Tangential_complex.h b/src/Tangential_complex/include/gudhi/Tangential_complex.h index fc368a5d..18919362 100644 --- a/src/Tangential_complex/include/gudhi/Tangential_complex.h +++ b/src/Tangential_complex/include/gudhi/Tangential_complex.h @@ -1131,7 +1131,7 @@ class Tangential_complex { Tr_vertex_handle vh = triangulation.insert_if_in_star(proj_pt, center_vertex); // Tr_vertex_handle vh = triangulation.insert(proj_pt); - if (vh != Tr_vertex_handle()) { + if (vh != Tr_vertex_handle() && vh->data() == (std::numeric_limits::max())) { #ifdef GUDHI_TC_VERY_VERBOSE ++num_inserted_points; #endif @@ -1293,6 +1293,8 @@ class Tangential_complex { if (index != i) incident_simplex.insert(index); } + GUDHI_CHECK(incident_simplex.size() == cur_dim_plus_1 - 1, + std::logic_error("update_star: wrong size of incident simplex")); star.push_back(incident_simplex); } } -- cgit v1.2.3 From c7cd528c7fa9a548dd47586ae258d33168e04a07 Mon Sep 17 00:00:00 2001 From: vrouvrea Date: Thu, 15 Dec 2016 09:27:42 +0000 Subject: Remove example.cpp Remove tangent traces in Tangential_complex.h Modify test_tangential_complex.cpp to make UT work git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/tangential_test@1875 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 1bd09671ca6f30c66cce7b48b382e1a8e4fbd3b5 --- src/Tangential_complex/example/CMakeLists.txt | 3 - src/Tangential_complex/example/example.cpp | 85 ---------------------- .../include/gudhi/Tangential_complex.h | 5 -- .../test/test_tangential_complex.cpp | 13 ++-- 4 files changed, 8 insertions(+), 98 deletions(-) delete mode 100644 src/Tangential_complex/example/example.cpp (limited to 'src/Tangential_complex') diff --git a/src/Tangential_complex/example/CMakeLists.txt b/src/Tangential_complex/example/CMakeLists.txt index 291432b0..32f6eebb 100644 --- a/src/Tangential_complex/example/CMakeLists.txt +++ b/src/Tangential_complex/example/CMakeLists.txt @@ -8,12 +8,9 @@ if(CGAL_FOUND) target_link_libraries(Tangential_complex_example_basic ${CGAL_LIBRARY} ${Boost_DATE_TIME_LIBRARY}) add_executable( Tangential_complex_example_with_perturb example_with_perturb.cpp ) target_link_libraries(Tangential_complex_example_with_perturb ${CGAL_LIBRARY} ${Boost_DATE_TIME_LIBRARY}) - add_executable( example example.cpp ) - target_link_libraries(example ${CGAL_LIBRARY} ${Boost_DATE_TIME_LIBRARY}) if (TBB_FOUND) target_link_libraries(Tangential_complex_example_basic ${TBB_LIBRARIES}) target_link_libraries(Tangential_complex_example_with_perturb ${TBB_LIBRARIES}) - target_link_libraries(example ${TBB_LIBRARIES}) endif(TBB_FOUND) add_test(Tangential_complex_example_basic diff --git a/src/Tangential_complex/example/example.cpp b/src/Tangential_complex/example/example.cpp deleted file mode 100644 index b7eb542b..00000000 --- a/src/Tangential_complex/example/example.cpp +++ /dev/null @@ -1,85 +0,0 @@ -#include -#include - -#include -#include - -#include -#include - -namespace tc = Gudhi::tangential_complex; - - -int main(void) { - typedef CGAL::Epick_d Kernel; - typedef Kernel::FT FT; - typedef Kernel::Point_d Point; - typedef Kernel::Vector_d Vector; - typedef tc::Tangential_complex TC; - - - const int INTRINSIC_DIM = 1; - - // Generate points on a 2-sphere - std::vector points; - // [[0, 0], [1, 0], [0, 1], [1, 1]] - std::vector point = {0.0, 0.0}; - points.push_back(Point(point.size(), point.begin(), point.end())); - point = {1.1, 0.0}; - points.push_back(Point(point.size(), point.begin(), point.end())); - point = {0.2, 1.3}; - points.push_back(Point(point.size(), point.begin(), point.end())); - point = {1.0, 1.0}; - points.push_back(Point(point.size(), point.begin(), point.end())); - std::cout << "points = " << points.size() << std::endl; - Kernel k; - - // Compute the TC - TC tc(points, INTRINSIC_DIM, k); - tc.compute_tangential_complex(); - TC::Num_inconsistencies num_inc = tc.number_of_inconsistent_simplices(); - std::cout << "TC vertices = " << tc.number_of_vertices() << " - simplices = " << num_inc.num_simplices << - " - inc simplices = " << num_inc.num_inconsistent_simplices << " - inc stars = " << num_inc.num_inconsistent_stars << std::endl; - - std::cout << "TC point[0] " << tc.get_point(0) << " - point[1] " << tc.get_point(1) << - " - point[2] " << tc.get_point(2) << " - point[3] " << tc.get_point(3) << std::endl; - - // Export the TC into a Simplex_tree - Gudhi::Simplex_tree<> stree; - int max_dim = tc.create_complex(stree); - stree.set_dimension(max_dim); - stree.initialize_filtration(); - - std::cout << "********************************************************************\n"; - std::cout << "* The complex contains " << stree.num_simplices() << " simplices"; - std::cout << " - dimension " << stree.dimension() << " - filtration " << stree.filtration() << "\n"; - std::cout << "* Iterator on Simplices in the filtration, with [filtration value]:\n"; - for (auto f_simplex : stree.filtration_simplex_range()) { - std::cout << " " << "[" << stree.filtration(f_simplex) << "] "; - for (auto vertex : stree.simplex_vertex_range(f_simplex)) { - std::cout << static_cast(vertex) << " "; - } - std::cout << std::endl; - } - - tc.fix_inconsistencies_using_perturbation(0.01, 30.0); - - // Export the TC into a Simplex_tree - max_dim = tc.create_complex(stree); - stree.set_dimension(max_dim); - stree.initialize_filtration(); - - std::cout << "********************************************************************\n"; - std::cout << "* The complex contains " << stree.num_simplices() << " simplices"; - std::cout << " - dimension " << stree.dimension() << " - filtration " << stree.filtration() << "\n"; - std::cout << "* Iterator on Simplices in the filtration, with [filtration value]:\n"; - for (auto f_simplex : stree.filtration_simplex_range()) { - std::cout << " " << "[" << stree.filtration(f_simplex) << "] "; - for (auto vertex : stree.simplex_vertex_range(f_simplex)) { - std::cout << static_cast(vertex) << " "; - } - std::cout << std::endl; - } - - return 0; -} diff --git a/src/Tangential_complex/include/gudhi/Tangential_complex.h b/src/Tangential_complex/include/gudhi/Tangential_complex.h index 18919362..6c0bbce6 100644 --- a/src/Tangential_complex/include/gudhi/Tangential_complex.h +++ b/src/Tangential_complex/include/gudhi/Tangential_complex.h @@ -1366,11 +1366,6 @@ class Tangential_complex { eig.eigenvectors().col(j).data() + m_ambient_dim)); } } - for (auto v : tsb) { - for (int i = 0; i < 2; ++i) - std::cerr << coord(v, i) << ", "; - std::cerr << "\n"; - } if (p_orth_space_basis) { p_orth_space_basis->set_origin(i); diff --git a/src/Tangential_complex/test/test_tangential_complex.cpp b/src/Tangential_complex/test/test_tangential_complex.cpp index 4c3dec3b..ebe5cdb4 100644 --- a/src/Tangential_complex/test/test_tangential_complex.cpp +++ b/src/Tangential_complex/test/test_tangential_complex.cpp @@ -98,11 +98,13 @@ BOOST_AUTO_TEST_CASE(test_mini_tangential) { tc.compute_tangential_complex(); TC::Num_inconsistencies num_inc = tc.number_of_inconsistent_simplices(); std::cout << "TC vertices = " << tc.number_of_vertices() << " - simplices = " << num_inc.num_simplices << - " - inconsistencies = " << num_inc.num_inconsistent_simplices << std::endl; + " - inc simplices = " << num_inc.num_inconsistent_simplices << + " - inc stars = " << num_inc.num_inconsistent_stars << std::endl; BOOST_CHECK(tc.number_of_vertices() == 4); BOOST_CHECK(num_inc.num_simplices == 4); - BOOST_CHECK(num_inc.num_inconsistent_simplices == 2); + BOOST_CHECK(num_inc.num_inconsistent_simplices == 0); + BOOST_CHECK(num_inc.num_inconsistent_stars == 0); // Export the TC into a Simplex_tree Gudhi::Simplex_tree<> stree; @@ -110,18 +112,19 @@ BOOST_AUTO_TEST_CASE(test_mini_tangential) { std::cout << "ST vertices = " << stree.num_vertices() << " - simplices = " << stree.num_simplices() << std::endl; BOOST_CHECK(stree.num_vertices() == 4); - BOOST_CHECK(stree.num_simplices() == 12); + BOOST_CHECK(stree.num_simplices() == 6); tc.fix_inconsistencies_using_perturbation(0.01, 30.0); BOOST_CHECK(tc.number_of_vertices() == 4); BOOST_CHECK(num_inc.num_simplices == 4); - BOOST_CHECK(num_inc.num_inconsistent_simplices == 2); + BOOST_CHECK(num_inc.num_inconsistent_simplices == 0); + BOOST_CHECK(num_inc.num_inconsistent_stars == 0); // Export the TC into a Simplex_tree tc.create_complex(stree); std::cout << "ST vertices = " << stree.num_vertices() << " - simplices = " << stree.num_simplices() << std::endl; BOOST_CHECK(stree.num_vertices() == 4); - BOOST_CHECK(stree.num_simplices() == 12); + BOOST_CHECK(stree.num_simplices() == 6); } -- cgit v1.2.3 From 72885b69e5fbe786f01b8275586281bb05198241 Mon Sep 17 00:00:00 2001 From: vrouvrea Date: Thu, 15 Dec 2016 09:41:12 +0000 Subject: Fix max issue on Windows git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/tangential_test@1876 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 957e2196a4a56308f76c0f55d182ffd3952eaf4e --- src/Tangential_complex/include/gudhi/Tangential_complex.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Tangential_complex') diff --git a/src/Tangential_complex/include/gudhi/Tangential_complex.h b/src/Tangential_complex/include/gudhi/Tangential_complex.h index 6c0bbce6..e7e50ce9 100644 --- a/src/Tangential_complex/include/gudhi/Tangential_complex.h +++ b/src/Tangential_complex/include/gudhi/Tangential_complex.h @@ -1131,7 +1131,7 @@ class Tangential_complex { Tr_vertex_handle vh = triangulation.insert_if_in_star(proj_pt, center_vertex); // Tr_vertex_handle vh = triangulation.insert(proj_pt); - if (vh != Tr_vertex_handle() && vh->data() == (std::numeric_limits::max())) { + if (vh != Tr_vertex_handle() && vh->data() == (std::numeric_limits::max)()) { #ifdef GUDHI_TC_VERY_VERBOSE ++num_inserted_points; #endif -- cgit v1.2.3 From 47374e6d54a8b251e421681d25d2e585d0203d19 Mon Sep 17 00:00:00 2001 From: vrouvrea Date: Thu, 15 Dec 2016 11:00:56 +0000 Subject: Remove unused modifications git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/tangential_test@1878 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 1b3dafad298e0caa87825ce47f6e8ac3983206a0 --- CMakeLists.txt | 14 +++++++------- src/Tangential_complex/example/CMakeLists.txt | 1 - src/Tangential_complex/include/gudhi/Tangential_complex.h | 2 -- 3 files changed, 7 insertions(+), 10 deletions(-) (limited to 'src/Tangential_complex') diff --git a/CMakeLists.txt b/CMakeLists.txt index 78de6c09..005df6d7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -73,13 +73,13 @@ else() set(Boost_USE_STATIC_RUNTIME OFF) # Find TBB package for parallel sort - not mandatory, just optional. - #set(TBB_FIND_QUIETLY ON) - #find_package(TBB) - #if (TBB_FOUND) - # include(${TBB_USE_FILE}) - # message("TBB found in ${TBB_LIBRARY_DIRS}") - # add_definitions(-DGUDHI_USE_TBB) - #endif() + set(TBB_FIND_QUIETLY ON) + find_package(TBB) + if (TBB_FOUND) + include(${TBB_USE_FILE}) + message("TBB found in ${TBB_LIBRARY_DIRS}") + add_definitions(-DGUDHI_USE_TBB) + endif() find_package(Eigen3 3.1.0) if (EIGEN3_FOUND) diff --git a/src/Tangential_complex/example/CMakeLists.txt b/src/Tangential_complex/example/CMakeLists.txt index 32f6eebb..a75ccd5b 100644 --- a/src/Tangential_complex/example/CMakeLists.txt +++ b/src/Tangential_complex/example/CMakeLists.txt @@ -18,7 +18,6 @@ if(CGAL_FOUND) add_test(Tangential_complex_example_with_perturb ${CMAKE_CURRENT_BINARY_DIR}/Tangential_complex_example_with_perturb) - endif(EIGEN3_FOUND) endif(NOT CGAL_VERSION VERSION_LESS 4.8.0) endif(CGAL_FOUND) diff --git a/src/Tangential_complex/include/gudhi/Tangential_complex.h b/src/Tangential_complex/include/gudhi/Tangential_complex.h index e7e50ce9..65de2743 100644 --- a/src/Tangential_complex/include/gudhi/Tangential_complex.h +++ b/src/Tangential_complex/include/gudhi/Tangential_complex.h @@ -1306,7 +1306,6 @@ class Tangential_complex { , bool normalize_basis = true , Orthogonal_space_basis *p_orth_space_basis = NULL ) { -// unsigned int num_pts_for_pca = static_cast (std::pow(GUDHI_TC_BASE_VALUE_FOR_PCA, m_intrinsic_dim)); unsigned int num_pts_for_pca = (std::min)(static_cast (std::pow(GUDHI_TC_BASE_VALUE_FOR_PCA, m_intrinsic_dim)), static_cast (m_points.size())); @@ -1397,7 +1396,6 @@ class Tangential_complex { // on it. Note that most points are duplicated. Tangent_space_basis compute_tangent_space(const Simplex &s, bool normalize_basis = true) { -// unsigned int num_pts_for_pca = static_cast (std::pow(GUDHI_TC_BASE_VALUE_FOR_PCA, m_intrinsic_dim)); unsigned int num_pts_for_pca = (std::min)(static_cast (std::pow(GUDHI_TC_BASE_VALUE_FOR_PCA, m_intrinsic_dim)), static_cast (m_points.size())); -- cgit v1.2.3