diff options
author | vrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb> | 2016-11-21 16:24:15 +0000 |
---|---|---|
committer | vrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb> | 2016-11-21 16:24:15 +0000 |
commit | 1a728400187d89db914e865a979c85c7260b0b02 (patch) | |
tree | ced1be64955f9a5a75f97334923948d147acb54d /src/Rips_complex/include/gudhi/Rips_complex.h | |
parent | d03c111cbb3329018d72c7ed8bea2d7ac9a57045 (diff) |
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
Diffstat (limited to 'src/Rips_complex/include/gudhi/Rips_complex.h')
-rw-r--r-- | src/Rips_complex/include/gudhi/Rips_complex.h | 13 |
1 files changed, 13 insertions, 0 deletions
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<InputPointRange, Distance >(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<typename InputDistanceRange> + 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. * |