From 706d447efdb0da311f02b3677ce19e4a68100b03 Mon Sep 17 00:00:00 2001 From: skachano Date: Wed, 28 Sep 2016 15:23:24 +0000 Subject: 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 --- .../include/gudhi/Witness_complex.h | 25 +++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 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 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 witnesses_, landmarks_; + + public: ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /* @name Constructor @@ -93,7 +100,7 @@ class Witness_complex { // Witness_range> /* - * \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, -- cgit v1.2.3