diff options
author | Vincent Rouvreau <VincentRouvreau@users.noreply.github.com> | 2019-05-22 08:21:15 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-22 08:21:15 +0200 |
commit | 0c7d6ae4ddb68422e02a48b6a5575c176041d3e4 (patch) | |
tree | 3565472af8636cf8fe6dac525fd0eae3711cc1ff /src/cython/include/Rips_complex_interface.h | |
parent | a33d17ebb1a5f7c830ee155ec2733a0f48211010 (diff) | |
parent | fe2f26629481faf316c74dafa7eae892bbc7a556 (diff) |
Merge pull request #49 from mglisse/sparsev3
All seems good to me and the new interface (with min and max) will allow to benchmark it with Strong collapse.
Diffstat (limited to 'src/cython/include/Rips_complex_interface.h')
-rw-r--r-- | src/cython/include/Rips_complex_interface.h | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/src/cython/include/Rips_complex_interface.h b/src/cython/include/Rips_complex_interface.h index 1a6e2477..40aff299 100644 --- a/src/cython/include/Rips_complex_interface.h +++ b/src/cython/include/Rips_complex_interface.h @@ -54,23 +54,17 @@ class Rips_complex_interface { } void init_points_sparse(const std::vector<std::vector<double>>& points, double threshold, double epsilon) { - sparse_rips_complex_.emplace(points, Gudhi::Euclidean_distance(), epsilon); - threshold_ = threshold; + sparse_rips_complex_.emplace(points, Gudhi::Euclidean_distance(), epsilon, -std::numeric_limits<double>::infinity(), threshold); } void init_matrix_sparse(const std::vector<std::vector<double>>& matrix, double threshold, double epsilon) { - sparse_rips_complex_.emplace(matrix, epsilon); - threshold_ = threshold; + sparse_rips_complex_.emplace(matrix, epsilon, -std::numeric_limits<double>::infinity(), threshold); } void create_simplex_tree(Simplex_tree_interface<>* simplex_tree, int dim_max) { if (rips_complex_) rips_complex_->create_complex(*simplex_tree, dim_max); - else { + else sparse_rips_complex_->create_complex(*simplex_tree, dim_max); - // This pruning should be done much earlier! It isn't that useful for sparse Rips, - // but it would be inconsistent not to do it. - simplex_tree->prune_above_filtration(threshold_); - } simplex_tree->initialize_filtration(); } @@ -79,7 +73,6 @@ class Rips_complex_interface { // Anyway, storing a graph would make more sense. Or changing the interface completely so there is no such storage. boost::optional<Rips_complex<Simplex_tree_interface<>::Filtration_value>> rips_complex_; boost::optional<Sparse_rips_complex<Simplex_tree_interface<>::Filtration_value>> sparse_rips_complex_; - double threshold_; }; } // namespace rips_complex |