Strong_witness_complex_interface.h
1 /* This file is part of the Gudhi Library. The Gudhi library
2  * (Geometric Understanding in Higher Dimensions) is a generic C++
3  * library for computational topology.
4  *
5  * Author(s): Vincent Rouvreau
6  *
7  * Copyright (C) 2016 INRIA
8  *
9  * This program is free software: you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation, either version 3 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program. If not, see <http://www.gnu.org/licenses/>.
21  */
22 
23 #ifndef INCLUDE_STRONG_WITNESS_COMPLEX_INTERFACE_H_
24 #define INCLUDE_STRONG_WITNESS_COMPLEX_INTERFACE_H_
25 
26 #include <gudhi/Simplex_tree.h>
27 #include <gudhi/Strong_witness_complex.h>
28 
29 #include "Simplex_tree_interface.h"
30 
31 #include <vector>
32 #include <utility> // std::pair
33 #include <iostream>
34 #include <cstddef>
35 
36 namespace Gudhi {
37 
38 namespace witness_complex {
39 
40 class Strong_witness_complex_interface {
41  using Nearest_landmark_range = std::vector<std::pair<std::size_t, double>>;
42  using Nearest_landmark_table = std::vector<Nearest_landmark_range>;
43 
44  public:
45  Strong_witness_complex_interface(const Nearest_landmark_table& nlt) {
46  witness_complex_ = new Strong_witness_complex<Nearest_landmark_table>(nlt);
47  }
48 
49  ~Strong_witness_complex_interface() {
50  delete witness_complex_;
51  }
52 
53  void create_simplex_tree(Simplex_tree_interface<>* simplex_tree, double max_alpha_square,
54  std::size_t limit_dimension) {
55  witness_complex_->create_complex(*simplex_tree, max_alpha_square, limit_dimension);
56  simplex_tree->initialize_filtration();
57  }
58 
59  void create_simplex_tree(Simplex_tree_interface<>* simplex_tree,
60  double max_alpha_square) {
61  witness_complex_->create_complex(*simplex_tree, max_alpha_square);
62  simplex_tree->initialize_filtration();
63  }
64 
65  private:
67 };
68 
69 } // namespace witness_complex
70 
71 } // namespace Gudhi
72 
73 #endif // INCLUDE_STRONG_WITNESS_COMPLEX_INTERFACE_H_
bool create_complex(SimplicialComplexForWitness &complex, double max_alpha_square, Landmark_id limit_dimension=std::numeric_limits< Landmark_id >::max()) const
Outputs the strong witness complex of relaxation &#39;max_alpha_square&#39; in a simplicial complex data stru...
Definition: Strong_witness_complex.h:96
Definition: SimplicialComplexForAlpha.h:26
Constructs strong witness complex for given sets of witnesses and landmarks in Euclidean space...
Definition: Euclidean_strong_witness_complex.h:47
GUDHI  Version 2.1.0  - C++ library for Topological Data Analysis (TDA) and Higher Dimensional Geometry Understanding.  - Copyright : GPL v3 Generated on Thu May 24 2018 09:46:12 for GUDHI by Doxygen 1.8.13