23 #ifndef INCLUDE_SIMPLEX_TREE_INTERFACE_H_ 24 #define INCLUDE_SIMPLEX_TREE_INTERFACE_H_ 26 #include <gudhi/graph_simplicial_complex.h> 28 #include <gudhi/Simplex_tree.h> 29 #include <gudhi/Points_off_io.h> 31 #include "Persistent_cohomology_interface.h" 39 template<
typename SimplexTreeOptions = Simplex_tree_options_full_featured>
40 class Simplex_tree_interface :
public Simplex_tree<SimplexTreeOptions> {
46 using Insertion_result =
typename std::pair<Simplex_handle, bool>;
47 using Simplex = std::vector<Vertex_handle>;
48 using Complex = std::vector<std::pair<Simplex, Filtration_value>>;
51 bool find_simplex(
const Simplex& vh) {
55 void assign_simplex_filtration(
const Simplex& vh,
Filtration_value filtration) {
61 return (result.second);
67 return (result.second);
73 return (result.second);
79 return (result.second);
85 return (result.second);
97 Complex get_filtration() {
103 simplex.insert(simplex.begin(), vertex);
105 filtrations.push_back(std::make_pair(simplex,
Base::filtration(f_simplex)));
110 Complex get_skeleton(
int dimension) {
115 simplex.insert(simplex.begin(), vertex);
122 Complex get_star(
const Simplex& simplex) {
125 Simplex simplex_star;
127 std::cout << vertex <<
" ";
128 simplex_star.insert(simplex_star.begin(), vertex);
130 std::cout << std::endl;
136 Complex get_cofaces(
const Simplex& simplex,
int dimension) {
139 Simplex simplex_coface;
141 std::cout << vertex <<
" ";
142 simplex_coface.insert(simplex_coface.begin(), vertex);
144 std::cout << std::endl;
145 cofaces.push_back(std::make_pair(simplex_coface,
Base::filtration(f_simplex)));
150 void create_persistence(Gudhi::Persistent_cohomology_interface<Base>* pcoh) {
152 pcoh =
new Gudhi::Persistent_cohomology_interface<Base>(*this);
158 #endif // INCLUDE_SIMPLEX_TREE_INTERFACE_H_ Dictionary::iterator Simplex_handle
Handle type to a simplex contained in the simplicial complex represented by the simplex tree...
Definition: Simplex_tree.h:135
Simplex Tree data structure for representing simplicial complexes.
Definition: Simplex_tree.h:72
std::pair< Simplex_handle, bool > insert_simplex_and_subfaces(const InputVertexRange &Nsimplex, Filtration_value filtration=0)
Insert a N-simplex and all his subfaces, from a N-simplex represented by a range of Vertex_handles...
Definition: Simplex_tree.h:683
static Simplex_handle null_simplex()
Returns a Simplex_handle different from all Simplex_handles associated to the simplices in the simpli...
Definition: Simplex_tree.h:431
Definition: SimplicialComplexForAlpha.h:26
Filtration_simplex_range const & filtration_simplex_range(Indexing_tag=Indexing_tag())
Returns a range over the simplices of the simplicial complex, in the order of the filtration...
Definition: Simplex_tree.h:248
void initialize_filtration()
Initializes the filtrations, i.e. sort the simplices according to their order in the filtration and i...
Definition: Simplex_tree.h:800
Simplex_handle find(const InputVertexRange &s)
Given a range of Vertex_handles, returns the Simplex_handle of the simplex in the simplicial complex ...
Definition: Simplex_tree.h:517
Value type for a filtration function on a cell complex.
Definition: FiltrationValue.h:32
Cofaces_simplex_range cofaces_simplex_range(const Simplex_handle simplex, int codimension)
Compute the cofaces of a n simplex.
Definition: Simplex_tree.h:892
void assign_filtration(Simplex_handle sh, Filtration_value fv)
Sets the filtration value of a simplex.
Definition: Simplex_tree.h:421
Simplex_vertex_range simplex_vertex_range(Simplex_handle sh)
Returns a range over the vertices of a simplex.
Definition: Simplex_tree.h:261
Global distance functions.
Options::Vertex_handle Vertex_handle
Type for the vertex handle.
Definition: Simplex_tree.h:87
Skeleton_simplex_range skeleton_simplex_range(int dim)
Returns a range over the simplices of the dim-skeleton of the simplicial complex. ...
Definition: Simplex_tree.h:228
Cofaces_simplex_range star_simplex_range(const Simplex_handle simplex)
Compute the star of a n simplex.
Definition: Simplex_tree.h:881
static Filtration_value filtration(Simplex_handle sh)
Returns the filtration value of a simplex.
Definition: Simplex_tree.h:410
void remove_maximal_simplex(Simplex_handle sh)
Remove a maximal simplex.
Definition: Simplex_tree.h:1378
Options::Filtration_value Filtration_value
Type for the value of the filtration function.
Definition: Simplex_tree.h:79
std::pair< Simplex_handle, bool > insert_simplex(const InputVertexRange &simplex, Filtration_value filtration=0)
Insert a simplex, represented by a range of Vertex_handles, in the simplicial complex.
Definition: Simplex_tree.h:654