From c0ad466a28bd3cc0ac88c0bbd49fc2e0a711afe9 Mon Sep 17 00:00:00 2001 From: skachano Date: Tue, 19 Jan 2016 16:33:41 +0000 Subject: Added a concept for Simplicial_complex, also added to doc about knn git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/witness@979 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 7d0a98369571ba5fc40196f41e74dd9d54b094ec --- .../include/gudhi/Witness_complex.h | 23 +++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) (limited to 'src/Witness_complex/include/gudhi/Witness_complex.h') diff --git a/src/Witness_complex/include/gudhi/Witness_complex.h b/src/Witness_complex/include/gudhi/Witness_complex.h index 2b6a6ad5..90b2e094 100644 --- a/src/Witness_complex/include/gudhi/Witness_complex.h +++ b/src/Witness_complex/include/gudhi/Witness_complex.h @@ -75,7 +75,7 @@ namespace Gudhi { typedef std::vector< double > Point_t; typedef std::vector< Point_t > Point_Vector; - typedef typename Simplicial_complex::Filtration_value Filtration_value; + //typedef typename Simplicial_complex::Filtration_value Filtration_value; typedef std::vector< Vertex_handle > typeVectorVertex; typedef std::pair< typeVectorVertex, Filtration_value> typeSimplex; typedef std::pair< Simplex_handle, bool > typePairSimplexBool; @@ -96,16 +96,25 @@ namespace Gudhi { */ //@{ + + // Witness_range> /** * \brief Iterative construction of the witness complex. * \details The witness complex is written in sc_ basing on a matrix knn of * nearest neighbours of the form {witnesses}x{landmarks}. - * Parameter dim serves as the limit for the number of closest landmarks to consider. + * + * The type KNearestNeighbors can be seen as + * Witness_range>, where + * Witness_range and Closest_landmark_range are random access ranges. + * + * Constructor takes into account at most (dim+1) + * first landmarks from each landmark range to construct simplices. + * * Landmarks are supposed to be in [0,nbL_-1] */ - template< typename KNearestNeighbours > - Witness_complex(KNearestNeighbours const & knn, + template< typename KNearestNeighbors > + Witness_complex(KNearestNeighbors const & knn, Simplicial_complex & sc_, int nbL_, int dim ): nbL(nbL_), sc(sc_) @@ -125,7 +134,7 @@ namespace Gudhi { // by doing it we don't assume that landmarks are necessarily witnesses themselves anymore counter++; vv = {i}; - returnValue = sc.insert_simplex(vv, Filtration_value(0.0)); + returnValue = sc.insert_simplex(vv); /* TODO Error if not inserted : normally no need here though*/ } int k=1; /* current dimension in iterative construction */ @@ -163,8 +172,8 @@ namespace Gudhi { * by witness witness_id are already in the complex. * inserted_vertex is the handle of the (k+1)-th vertex witnessed by witness_id */ - template - bool all_faces_in(KNearestNeighbours const &knn, int witness_id, int k) + template + bool all_faces_in(KNearestNeighbors const &knn, int witness_id, int k) { //std::cout << "All face in with the landmark " << inserted_vertex << std::endl; std::vector< Vertex_handle > facet; -- cgit v1.2.3