diff options
author | skachano <skachano@636b058d-ea47-450e-bf9e-a15bfbe3eedb> | 2016-09-28 15:23:24 +0000 |
---|---|---|
committer | skachano <skachano@636b058d-ea47-450e-bf9e-a15bfbe3eedb> | 2016-09-28 15:23:24 +0000 |
commit | 706d447efdb0da311f02b3677ce19e4a68100b03 (patch) | |
tree | d04ee9c71d3c8a8419d7d8042132118d454edf02 | |
parent | d16822ea1d3cedea66dcddd390becdd4cbb557bb (diff) |
Commit before a merge with subsampling
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/relaxed-witness@1583 636b058d-ea47-450e-bf9e-a15bfbe3eedb
Former-commit-id: c4ad9a3579b2e024b88402207ca58a8995167170
-rw-r--r-- | src/Witness_complex/example/CMakeLists.txt | 3 | ||||
-rw-r--r-- | src/Witness_complex/include/gudhi/Witness_complex.h | 25 |
2 files changed, 24 insertions, 4 deletions
diff --git a/src/Witness_complex/example/CMakeLists.txt b/src/Witness_complex/example/CMakeLists.txt index 4d67e0d0..0054775d 100644 --- a/src/Witness_complex/example/CMakeLists.txt +++ b/src/Witness_complex/example/CMakeLists.txt @@ -10,7 +10,8 @@ if(CGAL_FOUND) if (EIGEN3_FOUND) add_executable ( witness_complex_sphere witness_complex_sphere.cpp ) target_link_libraries(witness_complex_sphere ${Boost_SYSTEM_LIBRARY} ${CGAL_LIBRARY}) - add_test( witness_complex_sphere_10 ${CMAKE_CURRENT_BINARY_DIR}/witness_complex_sphere 10) + add_test( witness_complex_sphere_10 ${CMAKE_CURRENT_BINARY_DIR}/witness_complex_sphere 10) + add_executable ( relaxed_witness_persistence relaxed_witness_persistence.cpp ) endif(EIGEN3_FOUND) endif (NOT CGAL_VERSION VERSION_LESS 4.6.0) endif() diff --git a/src/Witness_complex/include/gudhi/Witness_complex.h b/src/Witness_complex/include/gudhi/Witness_complex.h index 489cdf11..5c6d087f 100644 --- a/src/Witness_complex/include/gudhi/Witness_complex.h +++ b/src/Witness_complex/include/gudhi/Witness_complex.h @@ -52,8 +52,13 @@ namespace witness_complex { // \brief Constructs the witness complex for the given set of witnesses and landmarks. // \ingroup witness_complex // */ -template< class SimplicialComplex> +template< class SimplicialComplex, + class Kernel_ > class Witness_complex { + typedef Kernel_ K; + typedef K::Point_d Point_d; + + private: struct Active_witness { int witness_id; @@ -82,7 +87,9 @@ class Witness_complex { private: int nbL_; // Number of landmarks SimplicialComplex& sc_; // Simplicial complex - + std::vector<Point_d> witnesses_, landmarks_; + + public: ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /* @name Constructor @@ -93,7 +100,7 @@ class Witness_complex { // Witness_range<Closest_landmark_range<Vertex_handle>> /* - * \brief Iterative construction of the witness complex. + * \brief Iterative construction of the (weak) witness complex. * \details The witness complex is written in sc_ basing on a matrix knn of * nearest neighbours of the form {witnesses}x{landmarks}. * @@ -106,6 +113,18 @@ class Witness_complex { * * Landmarks are supposed to be in [0,nbL_-1] */ + template< typename InputIteratorLandmarks, + typename InputIteratorWitnesses > + Witness_complex(InputIteratorLandmarks landmarks_first, + InputIteratorLandmarks landmarks_last, + InputIteratorWitnesses witnesses_first, + InputIteratorWitnesses witnesses_last) + : witnesses_(witnesses_first, witnesses_last), landmarks_(landmarks_first, landmarks_last) + { + } + + + template< typename KNearestNeighbors > Witness_complex(KNearestNeighbors const & knn, int nbL, |