summaryrefslogtreecommitdiff
path: root/src/Witness_complex/include/gudhi/Witness_complex.h
diff options
context:
space:
mode:
authorskachano <skachano@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2016-09-28 15:23:24 +0000
committerskachano <skachano@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2016-09-28 15:23:24 +0000
commit706d447efdb0da311f02b3677ce19e4a68100b03 (patch)
treed04ee9c71d3c8a8419d7d8042132118d454edf02 /src/Witness_complex/include/gudhi/Witness_complex.h
parentd16822ea1d3cedea66dcddd390becdd4cbb557bb (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
Diffstat (limited to 'src/Witness_complex/include/gudhi/Witness_complex.h')
-rw-r--r--src/Witness_complex/include/gudhi/Witness_complex.h25
1 files changed, 22 insertions, 3 deletions
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,