From 1a728400187d89db914e865a979c85c7260b0b02 Mon Sep 17 00:00:00 2001 From: vrouvrea Date: Mon, 21 Nov 2016 16:24:15 +0000 Subject: Add distance matrix rips construction (doc, code, test) git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/distance_matrix_in_rips_module@1766 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 6b9bdecbaf0aca12facb023e66bdea71e8e8cd38 --- src/Rips_complex/include/gudhi/Rips_complex.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/Rips_complex/include') diff --git a/src/Rips_complex/include/gudhi/Rips_complex.h b/src/Rips_complex/include/gudhi/Rips_complex.h index 6f947f41..63207892 100644 --- a/src/Rips_complex/include/gudhi/Rips_complex.h +++ b/src/Rips_complex/include/gudhi/Rips_complex.h @@ -78,6 +78,19 @@ class Rips_complex { compute_proximity_graph(points, threshold, distance); } + /** \brief Rips_complex constructor from a distance matrix. + * + * @param[in] distance_matrix Range of distances. + * @param[in] threshold rips value. + * + * The type InputDistanceRange must be a range for which std::begin and std::end return input iterators on a point. + */ + template + Rips_complex(const InputDistanceRange& distance_matrix, Filtration_value threshold) { + compute_proximity_graph(boost::irange((size_t)0,distance_matrix.size()), threshold, + [&](size_t i, size_t j){return distance_matrix[j][i];}); + } + /** \brief Initializes the simplicial complex from the 1-skeleton graph and expands it until a given maximal * dimension. * -- cgit v1.2.3