Loading...
Searching...
No Matches
Gudhi::Simplex_tree< SimplexTreeOptions > Class Template Reference
Filtered Complexes

Simplex Tree data structure for representing simplicial complexes. More...

`#include <gudhi/Simplex_tree.h>`

## Public Types

typedef Options::Filtration_value | Filtration_value
| Type for the value of the filtration function.
typedef Options::Simplex_key | Simplex_key
| Key associated to each simplex.
typedef Get_simplex_data_type< Options >::type | Simplex_data
| Extra data stored in each simplex.
typedef Options::Vertex_handle | Vertex_handle
| Type for the vertex handle.
typedef Simplex_tree_siblings< Simplex_tree, Dictionary > | Siblings
| Set of nodes sharing a same parent in the simplex tree.
typedef Dictionary::const_iterator | Simplex_handle
| Handle type to a simplex contained in the simplicial complex represented by the simplex tree.

## Public Member Functions

template<class OtherSimplexTreeOptions>
bool | operator== (const Simplex_tree< OtherSimplexTreeOptions > &st2) const
| Checks if two simplex trees are equal. Any extra data (Simplex_data) stored in the simplices are ignored in the comparison.
template<class OtherSimplexTreeOptions>
bool | operator!= (const Simplex_tree< OtherSimplexTreeOptions > &st2) const
| Checks if two simplex trees are different.
Simplex_handle | simplex (Simplex_key idx) const
| Returns the simplex that has index idx in the filtration.
void | assign_filtration (Simplex_handle sh, Filtration_value fv)
| Sets the filtration value of a simplex.
Simplex_data & | simplex_data (Simplex_handle sh)
| Returns the extra data stored in a simplex.
const Simplex_data & | simplex_data (Simplex_handle sh) const
| Returns the extra data stored in a simplex.
Vertex_handle | null_vertex () const
| Returns a Vertex_handle different from all Vertex_handles associated to the vertices of the simplicial complex.
size_t | num_vertices () const
| Returns the number of vertices in the complex.
bool | is_empty () const
| Returns whether the complex is empty.
size_t | num_simplices () const
| Returns the number of simplices in the simplex_tree.
std::vector< size_t > | num_simplices_by_dimension () const
| Returns the number of simplices of each dimension in the simplex tree.
int | dimension (Simplex_handle sh) const
| Returns the dimension of a simplex.
int | upper_bound_dimension () const
| Returns an upper bound on the dimension of the simplicial complex.
int | dimension () const
| Returns the dimension of the simplicial complex.
template<class SimplexHandle>
bool | has_children (SimplexHandle sh) const
| Returns true if the node in the simplex tree pointed by the given simplex handle has children.
template<class InputVertexRange = std::initializer_list<Vertex_handle>>
Simplex_handle | find (const InputVertexRange &s) const
| Given a range of Vertex_handles, returns the Simplex_handle of the simplex in the simplicial complex containing the corresponding vertices. Return null_simplex() if the simplex is not in the complex.
template<class InputVertexRange = std::initializer_list<Vertex_handle>>
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.
template<class InputVertexRange = std::initializer_list<Vertex_handle>>
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, in the simplicial complex.
void | assign_key (Simplex_handle sh, Simplex_key key)
| Assign a value 'key' to the key of the simplex represented by the Simplex_handle 'sh'.
std::pair< Simplex_handle, Simplex_handle > | endpoints (Simplex_handle sh) const
template<class SimplexHandle>
Siblings const * | self_siblings (SimplexHandle sh) const
template<class SimplexHandle>
Siblings * | self_siblings (SimplexHandle sh)
Siblings * | root ()
const Siblings * | root () const
void | set_dimension (int dimension, bool exact=true)
| Set a dimension for the simplicial complex.
void | initialize_filtration (bool ignore_infinite_values=false) const
| Initializes the filtration cache, i.e. sorts the simplices according to their order in the filtration.
void | maybe_initialize_filtration () const
| Initializes the filtration cache if it isn't initialized yet.
void | clear_filtration () const
| Clears the filtration cache produced by initialize_filtration().
Cofaces_simplex_range | star_simplex_range (const Simplex_handle simplex) const
| Compute the star of a n simplex.
Cofaces_simplex_range | cofaces_simplex_range (const Simplex_handle simplex, int codimension) const
| Compute the cofaces of a n simplex.
template<class OneSkeletonGraph>
void | insert_graph (const OneSkeletonGraph &skel_graph)
| Inserts a 1-skeleton in an empty Simplex_tree.
template<class VertexRange>
void | insert_batch_vertices (VertexRange const &vertices, Filtration_value filt=0)
| Inserts several vertices.
void | expansion (int max_dim)
| Expands the Simplex_tree containing only its one skeleton until dimension max_dim.
void | insert_edge_as_flag (Vertex_handle u, Vertex_handle v, Filtration_value fil, int dim_max, std::vector< Simplex_handle > &added_simplices)

Adds a new vertex or a new edge in a flag complex, as well as all simplices of its star, defined to maintain the property of the complex to be a flag complex, truncated at dimension dim_max. To insert a new edge, the two given vertex handles have to correspond to the two end points of the edge. To insert a new vertex, the handles have to be twice the same and correspond to the number you want assigned to it. I.e., to insert vertex \(i\), give \(u = v = i\). The method assumes that the given edge was not already contained in the simplex tree, so the behaviour is undefined if called on an existing edge. Also, the vertices of an edge have to be inserted before the edge.

template<typename Blocker>
void | expansion_with_blockers (int max_dim, Blocker block_simplex)
| Expands a simplex tree containing only a graph. Simplices corresponding to cliques in the graph are added incrementally, faces before cofaces, unless the simplex has dimension larger than max_dim or block_simplex returns true for this simplex.
void | print_hasse (std::ostream &os) const
| Write the hasse diagram of the simplicial complex in os.
template<class Fun>
void | for_each_simplex (Fun &&fun) const
bool | make_filtration_non_decreasing ()
| This function ensures that each simplex has a higher filtration value than its faces by increasing the filtration values.
void | clear ()
| Remove all the simplices, leaving an empty complex.
bool | prune_above_filtration (Filtration_value filtration)
| Prune above filtration value given as parameter.
bool | prune_above_dimension (int dimension)
| Remove all simplices of dimension greater than a given value.
void | remove_maximal_simplex (Simplex_handle sh)
| Remove a maximal simplex.
std::pair< Filtration_value, Extended_simplex_type > | decode_extended_filtration (Filtration_value f, const Extended_filtration_data &efd) const

Retrieve the original filtration value for a given simplex in the Simplex_tree. Since the computation of extended persistence requires modifying the filtration values, this function can be used to recover the original values. Moreover, computing extended persistence requires adding new simplices in the Simplex_tree. Hence, this function also outputs the type of each simplex. It can be either UP (which means that the simplex was present originally, and is thus part of the ascending extended filtration), DOWN (which means that the simplex is the cone of an original simplex, and is thus part of the descending extended filtration) or EXTRA (which means the simplex is the cone point). See the definition of Extended_simplex_type. Note that if the simplex type is DOWN, the original filtration value is set to be the original filtration value of the corresponding (not coned) original simplex.

Extended_filtration_data | extend_filtration ()
| Extend filtration for computing extended persistence. This function only uses the filtration values at the 0-dimensional simplices, and computes the extended persistence diagram induced by the lower-star filtration computed with these values.
Vertex_handle | vertex_with_same_filtration (Simplex_handle sh) const
| Returns a vertex of sh that has the same filtration value as sh if it exists, and null_vertex() otherwise.
Simplex_handle | edge_with_same_filtration (Simplex_handle sh) const
| Returns an edge of sh that has the same filtration value as sh if it exists, and null_simplex() otherwise.
Simplex_handle | minimal_simplex_with_same_filtration (Simplex_handle sh) const
| Returns a minimal face of sh that has the same filtration value as sh.
void | reset_filtration (Filtration_value filt_value, int min_dim=0)
| This function resets the filtration value of all the simplices of dimension at least min_dim. Resets all the Simplex_tree when min_dim = 0. reset_filtration may break the filtration property with min_dim > 0, and it is the user's responsibility to make it a valid filtration (using a large enough filt_value, or calling make_filtration_non_decreasing afterwards for instance).
Range and iterator methods
Complex_vertex_range | complex_vertex_range () const
| Returns a range over the vertices of the simplicial complex. The order is increasing according to < on Vertex_handles.
Complex_simplex_range | complex_simplex_range () const
| Returns a range over the simplices of the simplicial complex.
Skeleton_simplex_range | skeleton_simplex_range (int dim) const
| Returns a range over the simplices of the dim-skeleton of the simplicial complex.
Filtration_simplex_range const & | filtration_simplex_range (Indexing_tag=Indexing_tag()) const
| Returns a range over the simplices of the simplicial complex, in the order of the filtration.
Simplex_vertex_range | simplex_vertex_range (Simplex_handle sh) const
| Returns a range over the vertices of a simplex.
template<class SimplexHandle>
Boundary_simplex_range | boundary_simplex_range (SimplexHandle sh) const
| Returns a range over the simplices of the boundary of a simplex.
template<class SimplexHandle>
Boundary_opposite_vertex_simplex_range | boundary_opposite_vertex_simplex_range (SimplexHandle sh) const
| Given a simplex, returns a range over the simplices of its boundary and their opposite vertices.
Constructor/Destructor
| Simplex_tree ()
| Constructs an empty simplex tree.
template<typename OtherSimplexTreeOptions, typename F>
| Simplex_tree (const Simplex_tree< OtherSimplexTreeOptions > &complex_source, F &&translate_filtration_value)

Construct the simplex tree as the copy of a given simplex tree with eventually different template parameters. Therefore, should provide a method converting the filtration values of one tree to the another. All other values are already implicitly convertible if the concept of SimplexTreeOptions is respected (note that there is an eventual loss of precision or an undefined behaviour if a value is converted into a new type too small to contain it). Any extra data (Simplex_data) stored in the simplices are ignored in the copy for now.

| Simplex_tree (const Simplex_tree &complex_source)
| User-defined copy constructor reproduces the whole tree structure including extra data (Simplex_data) stored in the simplices.
| Simplex_tree (Simplex_tree &&complex_source)
| User-defined move constructor relocates the whole tree structure including extra data (Simplex_data) stored in the simplices.
| ~Simplex_tree ()
| Destructor; deallocates the whole tree structure.
Simplex_tree & | operator= (const Simplex_tree &complex_source)
| User-defined copy assignment reproduces the whole tree structure including extra data (Simplex_data) stored in the simplices.
Simplex_tree & | operator= (Simplex_tree &&complex_source)
| User-defined move assignment relocates the whole tree structure including extra data (Simplex_data) stored in the simplices.

## Static Public Member Functions

static Simplex_key | key (Simplex_handle sh)
| Returns the key associated to a simplex.
static Filtration_value | filtration (Simplex_handle sh)
| Returns the filtration value of a simplex.
static Simplex_handle | null_simplex ()
| Returns a Simplex_handle different from all Simplex_handles associated to the simplices in the simplicial complex.
static Simplex_key | null_key ()
| Returns a fixed number not in the interval [0, num_simplices()).

## Range and iterator types

The naming convention is Container_content_(iterator/range). A Container_content_range is essentially an object on which the methods begin() and end() can be called. They both return an object of type Container_content_iterator, and allow the traversal of the range [ begin();end() ).
typedef boost::transform_iterator< return_first, Dictionary_const_it > | Complex_vertex_iterator
| Iterator over the vertices of the simplicial complex.
typedef boost::iterator_range< Complex_vertex_iterator > | Complex_vertex_range
| Range over the vertices of the simplicial complex.
typedef Simplex_tree_simplex_vertex_iterator< Simplex_tree > | Simplex_vertex_iterator
| Iterator over the vertices of a simplex.
typedef boost::iterator_range< Simplex_vertex_iterator > | Simplex_vertex_range
| Range over the vertices of a simplex.
typedef std::conditional< Options::link_nodes_by_label, Optimized_cofaces_simplex_filtered_range, std::vector< Simplex_handle > >::type | Cofaces_simplex_range
| Range over the cofaces of a simplex.
typedef Simplex_tree_boundary_simplex_iterator< Simplex_tree > | Boundary_simplex_iterator
| Iterator over the simplices of the boundary of a simplex.
typedef boost::iterator_range< Boundary_simplex_iterator > | Boundary_simplex_range
| Range over the simplices of the boundary of a simplex.
typedef Simplex_tree_boundary_opposite_vertex_simplex_iterator< Simplex_tree > | Boundary_opposite_vertex_simplex_iterator
| Iterator over the simplices of the boundary of a simplex and their opposite vertices.
typedef boost::iterator_range< Boundary_opposite_vertex_simplex_iterator > | Boundary_opposite_vertex_simplex_range
| Range over the simplices of the boundary of a simplex and their opposite vertices.
typedef Simplex_tree_complex_simplex_iterator< Simplex_tree > | Complex_simplex_iterator
| Iterator over the simplices of the simplicial complex.
typedef boost::iterator_range< Complex_simplex_iterator > | Complex_simplex_range
| Range over the simplices of the simplicial complex.
typedef Simplex_tree_skeleton_simplex_iterator< Simplex_tree > | Skeleton_simplex_iterator
| Iterator over the simplices of the skeleton of the simplicial complex, for a given dimension.
typedef boost::iterator_range< Skeleton_simplex_iterator > | Skeleton_simplex_range
| Range over the simplices of the skeleton of the simplicial complex, for a given dimension.
typedef std::vector< Simplex_handle > | Filtration_simplex_range
| Range over the simplices of the simplicial complex, ordered by the filtration.
typedef Filtration_simplex_range::const_iterator | Filtration_simplex_iterator
| Iterator over the simplices of the simplicial complex, ordered by the filtration.

## Detailed Description

template<typename SimplexTreeOptions = Simplex_tree_options_default>
class Gudhi::Simplex_tree< SimplexTreeOptions >

Simplex Tree data structure for representing simplicial complexes.

Every simplex \([v_0, \cdots ,v_d]\) admits a canonical orientation induced by the order relation on vertices \( v_0 < \cdots < v_d \).

Details may be found in [boissonnatmariasimplextreealgorithmica].

Examples
  Alpha_complex_3d_from_points.cpp, Alpha_complex_from_off.cpp, Alpha_complex_from_points.cpp, CoordGIC.cpp, Fast_alpha_complex_from_off.cpp, FuncGIC.cpp, Nerve.cpp, VoronoiGIC.cpp, Weighted_alpha_complex_3d_from_points.cpp, Weighted_alpha_complex_from_points.cpp, alpha_complex_3d_persistence.cpp, alpha_complex_persistence.cpp, alpha_rips_persistence_bottleneck_distance.cpp, cech_complex_cgal_mini_sphere_3d.cpp, cech_complex_example_from_points.cpp, cech_persistence.cpp, custom_persistence_sort.cpp, distance_matrix_edge_collapse_rips_persistence.cpp, edge_collapse_conserve_persistence.cpp, example_alpha_shapes_3_simplex_tree_from_off_file.cpp, example_basic.cpp, example_nearest_landmark_table.cpp, example_one_skeleton_rips_from_correlation_matrix.cpp, example_one_skeleton_rips_from_distance_matrix.cpp, example_one_skeleton_rips_from_points.cpp, example_rips_complex_from_csv_distance_matrix_file.cpp, example_rips_complex_from_off_file.cpp, example_simplex_tree_to_matrix.cpp, example_sparse_rips.cpp, example_strong_witness_complex_off.cpp, example_with_perturb.cpp, example_witness_complex_off.cpp, example_witness_complex_sphere.cpp, graph_expansion_with_blocker.cpp, mini_simplex_tree.cpp, persistence_from_simple_simplex_tree.cpp, plain_homology.cpp, point_cloud_edge_collapse_rips_persistence.cpp, rips_correlation_matrix_persistence.cpp, rips_distance_matrix_persistence.cpp, rips_multifield_persistence.cpp, rips_persistence.cpp, rips_persistence_step_by_step.cpp, rips_persistence_via_boundary_matrix.cpp, simple_simplex_tree.cpp, sparse_rips_persistence.cpp, strong_witness_persistence.cpp, and weak_witness_persistence.cpp.

## Member Typedef Documentation

## Boundary_opposite_vertex_simplex_iterator

template<typename SimplexTreeOptions = Simplex_tree_options_default>

typedef Simplex_tree_boundary_opposite_vertex_simplex_iterator<Simplex_tree> Gudhi::Simplex_tree< SimplexTreeOptions >::Boundary_opposite_vertex_simplex_iterator

Iterator over the simplices of the boundary of a simplex and their opposite vertices.

'value_type' is std::pair<Simplex_handle, Vertex_handle>.

## Boundary_simplex_iterator

template<typename SimplexTreeOptions = Simplex_tree_options_default>

typedef Simplex_tree_boundary_simplex_iterator<Simplex_tree> Gudhi::Simplex_tree< SimplexTreeOptions >::Boundary_simplex_iterator

Iterator over the simplices of the boundary of a simplex.

'value_type' is Simplex_handle.

## Complex_simplex_iterator

template<typename SimplexTreeOptions = Simplex_tree_options_default>

typedef Simplex_tree_complex_simplex_iterator<Simplex_tree> Gudhi::Simplex_tree< SimplexTreeOptions >::Complex_simplex_iterator

Iterator over the simplices of the simplicial complex.

'value_type' is Simplex_handle.

## Complex_vertex_iterator

template<typename SimplexTreeOptions = Simplex_tree_options_default>

typedef boost::transform_iterator<return_first, Dictionary_const_it> Gudhi::Simplex_tree< SimplexTreeOptions >::Complex_vertex_iterator

Iterator over the vertices of the simplicial complex.

'value_type' is Vertex_handle.

## Filtration_simplex_iterator

template<typename SimplexTreeOptions = Simplex_tree_options_default>

typedef Filtration_simplex_range::const_iterator Gudhi::Simplex_tree< SimplexTreeOptions >::Filtration_simplex_iterator

Iterator over the simplices of the simplicial complex, ordered by the filtration.

'value_type' is Simplex_handle.

## Filtration_value

template<typename SimplexTreeOptions = Simplex_tree_options_default>

typedef Options::Filtration_value Gudhi::Simplex_tree< SimplexTreeOptions >::Filtration_value

Type for the value of the filtration function.

Must be comparable with <.

Examples
  strong_witness_persistence.cpp, and weak_witness_persistence.cpp.

## Simplex_data

template<typename SimplexTreeOptions = Simplex_tree_options_default>

typedef Get_simplex_data_type<Options>::type Gudhi::Simplex_tree< SimplexTreeOptions >::Simplex_data

Extra data stored in each simplex.

When extra data type is defined by the user, the extra data gets a default-initialization behaviour, which may mean an indeterminate value.

## Simplex_handle

template<typename SimplexTreeOptions = Simplex_tree_options_default>

typedef Dictionary::const_iterator Gudhi::Simplex_tree< SimplexTreeOptions >::Simplex_handle

Handle type to a simplex contained in the simplicial complex represented by the simplex tree.

They are essentially pointers into internal vectors, and any insertion or removal of a simplex may invalidate any other Simplex_handle in the complex, unless Options::stable_simplex_handles == true.

## Simplex_key

template<typename SimplexTreeOptions = Simplex_tree_options_default>

typedef Options::Simplex_key Gudhi::Simplex_tree< SimplexTreeOptions >::Simplex_key

Key associated to each simplex.

Must be an integer type.

## Simplex_vertex_iterator

template<typename SimplexTreeOptions = Simplex_tree_options_default>

typedef Simplex_tree_simplex_vertex_iterator<Simplex_tree> Gudhi::Simplex_tree< SimplexTreeOptions >::Simplex_vertex_iterator

Iterator over the vertices of a simplex.

'value_type' is Vertex_handle.

## Skeleton_simplex_iterator

template<typename SimplexTreeOptions = Simplex_tree_options_default>

typedef Simplex_tree_skeleton_simplex_iterator<Simplex_tree> Gudhi::Simplex_tree< SimplexTreeOptions >::Skeleton_simplex_iterator

Iterator over the simplices of the skeleton of the simplicial complex, for a given dimension.

'value_type' is Simplex_handle.

## Vertex_handle

template<typename SimplexTreeOptions = Simplex_tree_options_default>

typedef Options::Vertex_handle Gudhi::Simplex_tree< SimplexTreeOptions >::Vertex_handle

Type for the vertex handle.

Must be a signed integer type. It admits a total order <.

## Constructor & Destructor Documentation

## Simplex_tree() [1/2]

template<typename SimplexTreeOptions = Simplex_tree_options_default>
template<typename OtherSimplexTreeOptions, typename F>

Gudhi::Simplex_tree< SimplexTreeOptions >::Simplex_tree | ( | const Simplex_tree< OtherSimplexTreeOptions > & | complex_source,
|  | F && | translate_filtration_value )

inline

Construct the simplex tree as the copy of a given simplex tree with eventually different template parameters. Therefore, should provide a method converting the filtration values of one tree to the another. All other values are already implicitly convertible if the concept of SimplexTreeOptions is respected (note that there is an eventual loss of precision or an undefined behaviour if a value is converted into a new type too small to contain it). Any extra data (Simplex_data) stored in the simplices are ignored in the copy for now.

Template Parameters

  OtherSimplexTreeOptions | Options of the given simplex tree.
  F | Method taking an OtherSimplexTreeOptions::Filtration_value as input and returning an Options::Filtration_value.

Parameters

  complex_source | Simplex tree to copy.
  translate_filtration_value | Method taking an OtherSimplexTreeOptions::Filtration_value from the source tree as input and returning the corresponding Options::Filtration_value in the new tree.

## Simplex_tree() [2/2]

template<typename SimplexTreeOptions = Simplex_tree_options_default>

Gudhi::Simplex_tree< SimplexTreeOptions >::Simplex_tree | ( | Simplex_tree< SimplexTreeOptions > && | complex_source | ) |

inline

User-defined move constructor relocates the whole tree structure including extra data (Simplex_data) stored in the simplices.

Exceptions

  std::invalid_argument | In debug mode, if the complex_source is invalid.

## Member Function Documentation

## assign_filtration()

template<typename SimplexTreeOptions = Simplex_tree_options_default>

void Gudhi::Simplex_tree< SimplexTreeOptions >::assign_filtration | ( | Simplex_handle | sh,
|  | Filtration_value | fv )

inline

Sets the filtration value of a simplex.

Exceptions

  std::invalid_argument | In debug mode, if sh is a null_simplex.

## boundary_opposite_vertex_simplex_range()

template<typename SimplexTreeOptions = Simplex_tree_options_default>
template<class SimplexHandle>

Boundary_opposite_vertex_simplex_range Gudhi::Simplex_tree< SimplexTreeOptions >::boundary_opposite_vertex_simplex_range | ( | SimplexHandle | sh | ) | const

inline

Given a simplex, returns a range over the simplices of its boundary and their opposite vertices.

The boundary of a simplex is the set of codimension \(1\) subsimplices of the simplex. If the simplex is \([v_0, \cdots ,v_d]\), with canonical orientation induced by \( v_0 < \cdots < v_d \), the iterator enumerates the simplices of the boundary in the order: \([v_0,\cdots,\widehat{v_i},\cdots,v_d]\) for \(i\) from \(d\) to \(0\), where \(\widehat{v_i}\) means that the vertex \(v_i\), known as the opposite vertex, is omitted from boundary, but returned as the second element of a pair.

Parameters

  [in] | sh | Simplex for which the boundary is computed.

## boundary_simplex_range()

template<typename SimplexTreeOptions = Simplex_tree_options_default>
template<class SimplexHandle>

Boundary_simplex_range Gudhi::Simplex_tree< SimplexTreeOptions >::boundary_simplex_range | ( | SimplexHandle | sh | ) | const

inline

Returns a range over the simplices of the boundary of a simplex.

The boundary of a simplex is the set of codimension \(1\) subsimplices of the simplex. If the simplex is \([v_0, \cdots ,v_d]\), with canonical orientation induced by \( v_0 < \cdots < v_d \), the iterator enumerates the simplices of the boundary in the order: \([v_0,\cdots,\widehat{v_i},\cdots,v_d]\) for \(i\) from \(0\) to \(d\), where \(\widehat{v_i}\) means that the vertex \(v_i\) is omitted.

We note that the alternate sum of the simplices given by the iterator gives \((-1)^{\text{dim} \sigma}\) the chains corresponding to the boundary of the simplex.

Parameters

  [in] | sh | Simplex for which the boundary is computed.

## clear_filtration()

template<typename SimplexTreeOptions = Simplex_tree_options_default>

void Gudhi::Simplex_tree< SimplexTreeOptions >::clear_filtration | ( |  | ) | const

inline

Clears the filtration cache produced by initialize_filtration().

Useful when initialize_filtration() has already been called and we perform an operation (say an insertion) that invalidates the cache.

Note
  Not thread safe

## cofaces_simplex_range()

template<typename SimplexTreeOptions = Simplex_tree_options_default>

Cofaces_simplex_range Gudhi::Simplex_tree< SimplexTreeOptions >::cofaces_simplex_range | ( | const Simplex_handle | simplex,
|  | int | codimension ) const

inline

Compute the cofaces of a n simplex.

Parameters

  simplex | represent the n-simplex of which we search the n+codimension cofaces
  codimension | The function returns the n+codimension-cofaces of the n-simplex. If codimension = 0, return all cofaces (equivalent of star function)

Returns
  Vector of Simplex_tree::Simplex_handle (empty vector if no cofaces found) when SimplexTreeOptions::link_nodes_by_label is false.

Simplex_tree::Simplex_handle range for an optimized search for the coface of a simplex when SimplexTreeOptions::link_nodes_by_label is true.

## complex_simplex_range()

template<typename SimplexTreeOptions = Simplex_tree_options_default>

Complex_simplex_range Gudhi::Simplex_tree< SimplexTreeOptions >::complex_simplex_range | ( |  | ) | const

inline

Returns a range over the simplices of the simplicial complex.

In the Simplex_tree, the tree is traverse in a depth-first fashion. Consequently, simplices are ordered according to lexicographic order on the list of Vertex_handles of a simplex, read in increasing < order for Vertex_handles.

## decode_extended_filtration()

template<typename SimplexTreeOptions = Simplex_tree_options_default>

std::pair< Filtration_value, Extended_simplex_type > Gudhi::Simplex_tree< SimplexTreeOptions >::decode_extended_filtration | ( | Filtration_value | f,
|  | const Extended_filtration_data & | efd ) const

inline

Retrieve the original filtration value for a given simplex in the Simplex_tree. Since the computation of extended persistence requires modifying the filtration values, this function can be used to recover the original values. Moreover, computing extended persistence requires adding new simplices in the Simplex_tree. Hence, this function also outputs the type of each simplex. It can be either UP (which means that the simplex was present originally, and is thus part of the ascending extended filtration), DOWN (which means that the simplex is the cone of an original simplex, and is thus part of the descending extended filtration) or EXTRA (which means the simplex is the cone point). See the definition of Extended_simplex_type. Note that if the simplex type is DOWN, the original filtration value is set to be the original filtration value of the corresponding (not coned) original simplex.

Precondition
  This function should be called only if extend_filtration() has been called first!

Postcondition
  The output filtration value is supposed to be the same, but might be a little different, than the original filtration value, due to the internal transformation (scaling to [-2,-1]) that is performed on the original filtration values during the computation of extended persistence.

Parameters

  [in] | f | Filtration value of the simplex in the extended (i.e., modified) filtration.
  [in] | efd | Structure containing the minimum and maximum values of the original filtration. This the output of extend_filtration().

Returns
  A pair containing the original filtration value of the simplex as well as the simplex type.

## dimension() [1/2]

template<typename SimplexTreeOptions = Simplex_tree_options_default>

int Gudhi::Simplex_tree< SimplexTreeOptions >::dimension | ( |  | ) | const

inline

Returns the dimension of the simplicial complex.

This function is not constant time because it can recompute dimension if required (can be triggered by remove_maximal_simplex() or prune_above_filtration()).

Note
  Not thread safe

## dimension() [2/2]

template<typename SimplexTreeOptions = Simplex_tree_options_default>

int Gudhi::Simplex_tree< SimplexTreeOptions >::dimension | ( | Simplex_handle | sh | ) | const

inline

Returns the dimension of a simplex.

Must be different from null_simplex().

## edge_with_same_filtration()

template<typename SimplexTreeOptions = Simplex_tree_options_default>

Simplex_handle Gudhi::Simplex_tree< SimplexTreeOptions >::edge_with_same_filtration | ( | Simplex_handle | sh | ) | const

inline

Returns an edge of sh that has the same filtration value as sh if it exists, and null_simplex() otherwise.

For a flag-complex built with expansion(), this is a way to invert the process and find out which edge had its filtration value propagated to sh. If several edges have the same filtration value, the one it returns is arbitrary.

Precondition
  sh must have dimension at least 1.

## endpoints()

template<typename SimplexTreeOptions = Simplex_tree_options_default>

std::pair< Simplex_handle, Simplex_handle > Gudhi::Simplex_tree< SimplexTreeOptions >::endpoints | ( | Simplex_handle | sh | ) | const

inline

Returns the two Simplex_handle corresponding to the endpoints of and edge. sh must point to a 1-dimensional simplex. This is an optimized version of the boundary computation.

## expansion()

template<typename SimplexTreeOptions = Simplex_tree_options_default>

void Gudhi::Simplex_tree< SimplexTreeOptions >::expansion | ( | int | max_dim | ) |

inline

Expands the Simplex_tree containing only its one skeleton until dimension max_dim.

The expanded simplicial complex until dimension \(d\) attached to a graph \(G\) is the maximal simplicial complex of dimension at most \(d\) admitting the graph \(G\) as \(1\)-skeleton. The filtration value assigned to a simplex is the maximal filtration value of one of its edges.

The Simplex_tree must contain no simplex of dimension bigger than 1 when calling the method.

## expansion_with_blockers()

template<typename SimplexTreeOptions = Simplex_tree_options_default>
template<typename Blocker>

void Gudhi::Simplex_tree< SimplexTreeOptions >::expansion_with_blockers | ( | int | max_dim,
|  | Blocker | block_simplex )

inline

Expands a simplex tree containing only a graph. Simplices corresponding to cliques in the graph are added incrementally, faces before cofaces, unless the simplex has dimension larger than max_dim or block_simplex returns true for this simplex.

Parameters

  [in] | max_dim | Expansion maximal dimension value.
  [in] | block_simplex | Blocker oracle. Its concept is `bool block_simplex(Simplex_handle sh)`

The function identifies a candidate simplex whose faces are all already in the complex, inserts it with a filtration value corresponding to the maximum of the filtration values of the faces, then calls block_simplex on a Simplex_handle for this new simplex. If block_simplex returns true, the simplex is removed, otherwise it is kept. Note that the evaluation of block_simplex is a good time to update the filtration value of the simplex if you want a customized value. The algorithm then proceeds with the next candidate.

Warning
  several candidates of the same dimension may be inserted simultaneously before calling block_simplex, so if you examine the complex in block_simplex, you may hit a few simplices of the same dimension that have not been vetted by block_simplex yet, or have already been rejected but not yet removed.

## extend_filtration()

template<typename SimplexTreeOptions = Simplex_tree_options_default>

Extended_filtration_data Gudhi::Simplex_tree< SimplexTreeOptions >::extend_filtration | ( |  | ) |

inline

Extend filtration for computing extended persistence. This function only uses the filtration values at the 0-dimensional simplices, and computes the extended persistence diagram induced by the lower-star filtration computed with these values.

Postcondition
  Note that after calling this function, the filtration values are actually modified. The function decode_extended_filtration() retrieves the original values and outputs the extended simplex type.

Exceptions

  std::invalid_argument | In debug mode if the Simplex tree contains a vertex with the largest Vertex_handle, as this method requires to create an extra vertex internally.

Returns
  A data structure containing the maximum and minimum values of the original filtration. It is meant to be provided as input to decode_extended_filtration() in order to retrieve the original filtration values for each simplex.

## filtration()

template<typename SimplexTreeOptions = Simplex_tree_options_default>

Filtration_value Gudhi::Simplex_tree< SimplexTreeOptions >::filtration | ( | Simplex_handle | sh | ) |

inline static

Returns the filtration value of a simplex.

Called on the null_simplex, it returns infinity. If SimplexTreeOptions::store_filtration is false, returns 0.

Examples
  Alpha_complex_3d_from_points.cpp, Alpha_complex_from_off.cpp, Alpha_complex_from_points.cpp, Fast_alpha_complex_from_off.cpp, Weighted_alpha_complex_3d_from_points.cpp, Weighted_alpha_complex_from_points.cpp, and edge_collapse_conserve_persistence.cpp.

## filtration_simplex_range()

template<typename SimplexTreeOptions = Simplex_tree_options_default>

Filtration_simplex_range const & Gudhi::Simplex_tree< SimplexTreeOptions >::filtration_simplex_range | ( | Indexing_tag | = Indexing_tag() | ) | const

inline

Returns a range over the simplices of the simplicial complex, in the order of the filtration.

The filtration is a monotonic function \( f: \mathbf{K} \rightarrow \mathbb{R} \), i.e. if two simplices \(\tau\) and \(\sigma\) satisfy \(\tau \subseteq \sigma\) then \(f(\tau) \leq f(\sigma)\).

The method returns simplices ordered according to increasing filtration values. Ties are resolved by considering inclusion relation (subsimplices appear before their cofaces). If two simplices have same filtration value but are not comparable w.r.t. inclusion, lexicographic order is used.

The filtration must be valid. If the filtration has not been initialized yet, the method initializes it (i.e. order the simplices). If the complex has changed since the last time the filtration was initialized, please call clear_filtration() or initialize_filtration() to recompute it.

Note
  Not thread safe

Examples
  Alpha_complex_3d_from_points.cpp, Alpha_complex_from_off.cpp, Alpha_complex_from_points.cpp, CoordGIC.cpp, Fast_alpha_complex_from_off.cpp, FuncGIC.cpp, Nerve.cpp, VoronoiGIC.cpp, Weighted_alpha_complex_3d_from_points.cpp, and Weighted_alpha_complex_from_points.cpp.

## find()

template<typename SimplexTreeOptions = Simplex_tree_options_default>
template<class InputVertexRange = std::initializer_list<Vertex_handle>>

Simplex_handle Gudhi::Simplex_tree< SimplexTreeOptions >::find | ( | const InputVertexRange & | s | ) | const

inline

Given a range of Vertex_handles, returns the Simplex_handle of the simplex in the simplicial complex containing the corresponding vertices. Return null_simplex() if the simplex is not in the complex.

The type InputVertexRange must be a range of `Vertex_handle` on which we can call std::begin() function

## for_each_simplex()

template<typename SimplexTreeOptions = Simplex_tree_options_default>
template<class Fun>

void Gudhi::Simplex_tree< SimplexTreeOptions >::for_each_simplex | ( | Fun && | fun | ) | const

inline

Calls a function on each simplex. The order ensures that faces are visited before cofaces. While it is fine to modify the data of a simplex (filtration, key) in the function, modifying the structure itself (insertion, removal) is not supported.

Parameters

  [in] | fun | Function that takes as argument a Simplex_handle and an int (representing the dimension of this simplex). It may return void or bool, and in the second case returning true means that the iteration will skip the children of this simplex (a subset of the cofaces).

## initialize_filtration()

template<typename SimplexTreeOptions = Simplex_tree_options_default>

void Gudhi::Simplex_tree< SimplexTreeOptions >::initialize_filtration | ( | bool | ignore_infinite_values = false | ) | const

inline

Initializes the filtration cache, i.e. sorts the simplices according to their order in the filtration.

It always recomputes the cache, even if one already exists.

Any insertion, deletion or change of filtration value invalidates this cache, which can be cleared with clear_filtration().

Note
  Not thread safe

Examples
  strong_witness_persistence.cpp, and weak_witness_persistence.cpp.

## insert_batch_vertices()

template<typename SimplexTreeOptions = Simplex_tree_options_default>
template<class VertexRange>

void Gudhi::Simplex_tree< SimplexTreeOptions >::insert_batch_vertices | ( | VertexRange const & | vertices,
|  | Filtration_value | filt = 0 )

inline

Inserts several vertices.

Parameters

  [in] | vertices | A range of Vertex_handle
  [in] | filt | filtration value of the new vertices (the same for all)

This may be faster than inserting the vertices one by one, especially in a random order. The complex does not need to be empty before calling this function. However, if a vertex is already present, its filtration value is not modified, unlike with other insertion functions.

## insert_edge_as_flag()

template<typename SimplexTreeOptions = Simplex_tree_options_default>

void Gudhi::Simplex_tree< SimplexTreeOptions >::insert_edge_as_flag | ( | Vertex_handle | u,
|  | Vertex_handle | v,
|  | Filtration_value | fil,
|  | int | dim_max,
|  | std::vector< Simplex_handle > & | added_simplices )

inline

Adds a new vertex or a new edge in a flag complex, as well as all simplices of its star, defined to maintain the property of the complex to be a flag complex, truncated at dimension dim_max. To insert a new edge, the two given vertex handles have to correspond to the two end points of the edge. To insert a new vertex, the handles have to be twice the same and correspond to the number you want assigned to it. I.e., to insert vertex \(i\), give \(u = v = i\). The method assumes that the given edge was not already contained in the simplex tree, so the behaviour is undefined if called on an existing edge. Also, the vertices of an edge have to be inserted before the edge.

Parameters

  [in] | u,v | Vertex_handle representing the new edge (`v` != `u`) or the new vertex (`v` == `u`).
  [in] | fil | Filtration value of the edge.
  [in] | dim_max | Maximal dimension of the expansion. If set to -1, the expansion goes as far as possible.
  [out] | added_simplices | Contains at the end all new simplices induced by the insertion of the edge. The container is not emptied and new simplices are appended at the end.

Precondition
  SimplexTreeOptions::link_nodes_by_label must be true.
  When inserting the edge [u,v], the vertices `u` and `v` have to be already inserted in the simplex tree.

Warning
  If the edges and vertices are not inserted in the order of their filtration values, the method make_filtration_non_decreasing() has to be called at the end of the insertions to restore the intended filtration. Note that even then, an edge has to be inserted after its vertices.
  The method assumes that the given edge or vertex was not already contained in the simplex tree, so the behaviour is undefined if called on an existing simplex.

In term of edges in the graph, inserting edge [u,v] only affects the subtree rooted at `u`.

For a new node with label `v`, we first do a local expansion for computing the children of this new node, and then a standard expansion for its children. Nodes with label `v` (and their subtrees) already in the tree do not get affected.

Nodes with label `u` get affected only if a Node with label `v` is in their same siblings set. We then try to insert "punctually" `v` all over the subtree rooted at Node(u). Each insertion of a Node with `v` label induces a local expansion at this Node (as explained above) and a sequence of "punctual" insertion of Node(v) in the subtree rooted at sibling nodes of the new node, on its left.

## insert_graph()

template<typename SimplexTreeOptions = Simplex_tree_options_default>
template<class OneSkeletonGraph>

void Gudhi::Simplex_tree< SimplexTreeOptions >::insert_graph | ( | const OneSkeletonGraph & | skel_graph | ) |

inline

Inserts a 1-skeleton in an empty Simplex_tree.

The Simplex_tree must contain no simplex when the method is called.

Inserts all vertices and edges given by a OneSkeletonGraph. OneSkeletonGraph must be a model of boost::VertexAndEdgeListGraph and boost::PropertyGraph.

The vertex filtration value is accessible through the property tag vertex_filtration_t. The edge filtration value is accessible through the property tag edge_filtration_t.

boost::graph_traits<OneSkeletonGraph>::vertex_descriptor must be Vertex_handle. boost::graph_traits<OneSkeletonGraph>::directed_category can be directed_tag (the fastest, the least RAM use), undirected_tag or even bidirected_tag.

If an edge appears with multiplicity, the function will arbitrarily pick one representative to read the filtration value.

## insert_simplex()

template<typename SimplexTreeOptions = Simplex_tree_options_default>
template<class InputVertexRange = std::initializer_list<Vertex_handle>>

std::pair< Simplex_handle, bool > Gudhi::Simplex_tree< SimplexTreeOptions >::insert_simplex | ( | const InputVertexRange & | simplex,
|  | Filtration_value | filtration = 0 )

inline

Insert a simplex, represented by a range of Vertex_handles, in the simplicial complex.

Parameters

  [in] | simplex | range of Vertex_handles, representing the vertices of the new simplex
  [in] | filtration | the filtration value assigned to the new simplex.

Returns
  If the new simplex is inserted successfully (i.e. it was not in the simplicial complex yet) the bool is set to true and the Simplex_handle is the handle assigned to the new simplex. If the insertion fails (the simplex is already there), the bool is set to false. If the insertion fails and the simplex already in the complex has a filtration value strictly bigger than 'filtration', we assign this simplex with the new value 'filtration', and set the Simplex_handle field of the output pair to the Simplex_handle of the simplex. Otherwise, we set the Simplex_handle part to null_simplex.

All subsimplices do not necessary need to be already in the simplex tree to proceed to an insertion. However, the property of being a simplicial complex will be violated. This allows us to insert a stream of simplices contained in a simplicial complex without considering any order on them.

The filtration value assigned to the new simplex must preserve the monotonicity of the filtration.

The type InputVertexRange must be a range for which .begin() and .end() return input iterators, with 'value_type' Vertex_handle.

## insert_simplex_and_subfaces()

template<typename SimplexTreeOptions = Simplex_tree_options_default>
template<class InputVertexRange = std::initializer_list<Vertex_handle>>

std::pair< Simplex_handle, bool > Gudhi::Simplex_tree< SimplexTreeOptions >::insert_simplex_and_subfaces | ( | const InputVertexRange & | Nsimplex,
|  | Filtration_value | filtration = 0 )

inline

Insert a N-simplex and all his subfaces, from a N-simplex represented by a range of Vertex_handles, in the simplicial complex.

Parameters

  [in] | Nsimplex | range of Vertex_handles, representing the vertices of the new N-simplex
  [in] | filtration | the filtration value assigned to the new N-simplex.

Returns
  If the new simplex is inserted successfully (i.e. it was not in the simplicial complex yet) the bool is set to true and the Simplex_handle is the handle assigned to the new simplex. If the insertion fails (the simplex is already there), the bool is set to false. If the insertion fails and the simplex already in the complex has a filtration value strictly bigger than 'filtration', we assign this simplex with the new value 'filtration', and set the Simplex_handle field of the output pair to the Simplex_handle of the simplex. Otherwise, we set the Simplex_handle part to null_simplex.

## key()

template<typename SimplexTreeOptions = Simplex_tree_options_default>

Simplex_key Gudhi::Simplex_tree< SimplexTreeOptions >::key | ( | Simplex_handle | sh | ) |

inline static

Returns the key associated to a simplex.

If no key has been assigned, returns null_key().

Precondition
  SimplexTreeOptions::store_key

## make_filtration_non_decreasing()

template<typename SimplexTreeOptions = Simplex_tree_options_default>

bool Gudhi::Simplex_tree< SimplexTreeOptions >::make_filtration_non_decreasing | ( |  | ) |

inline

This function ensures that each simplex has a higher filtration value than its faces by increasing the filtration values.

Returns
  True if any filtration value was modified, false if the filtration was already non-decreasing.

If a simplex has a NaN filtration value, it is considered lower than any other defined filtration value.

## maybe_initialize_filtration()

template<typename SimplexTreeOptions = Simplex_tree_options_default>

void Gudhi::Simplex_tree< SimplexTreeOptions >::maybe_initialize_filtration | ( |  | ) | const

inline

Initializes the filtration cache if it isn't initialized yet.

Automatically called by filtration_simplex_range().

Note
  Not thread safe

## minimal_simplex_with_same_filtration()

template<typename SimplexTreeOptions = Simplex_tree_options_default>

Simplex_handle Gudhi::Simplex_tree< SimplexTreeOptions >::minimal_simplex_with_same_filtration | ( | Simplex_handle | sh | ) | const

inline

Returns a minimal face of sh that has the same filtration value as sh.

For a filtration built with make_filtration_non_decreasing(), this is a way to invert the process and find out which simplex had its filtration value propagated to sh. If several minimal (for inclusion) simplices have the same filtration value, the one it returns is arbitrary, and it is not guaranteed to be the one with smallest dimension.

## null_simplex()

template<typename SimplexTreeOptions = Simplex_tree_options_default>

Simplex_handle Gudhi::Simplex_tree< SimplexTreeOptions >::null_simplex | ( |  | ) |

inline static

Returns a Simplex_handle different from all Simplex_handles associated to the simplices in the simplicial complex.

One can call filtration(null_simplex()).

## num_simplices()

template<typename SimplexTreeOptions = Simplex_tree_options_default>

size_t Gudhi::Simplex_tree< SimplexTreeOptions >::num_simplices | ( |  | ) | const

inline

Returns the number of simplices in the simplex_tree.

This function takes time linear in the number of simplices.

Examples
  Alpha_complex_3d_from_points.cpp, Alpha_complex_from_off.cpp, Alpha_complex_from_points.cpp, CoordGIC.cpp, Fast_alpha_complex_from_off.cpp, FuncGIC.cpp, Nerve.cpp, VoronoiGIC.cpp, Weighted_alpha_complex_3d_from_points.cpp, Weighted_alpha_complex_from_points.cpp, example_strong_witness_complex_off.cpp, example_witness_complex_off.cpp, example_witness_complex_sphere.cpp, strong_witness_persistence.cpp, and weak_witness_persistence.cpp.

## operator=()

template<typename SimplexTreeOptions = Simplex_tree_options_default>

Simplex_tree & Gudhi::Simplex_tree< SimplexTreeOptions >::operator= | ( | Simplex_tree< SimplexTreeOptions > && | complex_source | ) |

inline

User-defined move assignment relocates the whole tree structure including extra data (Simplex_data) stored in the simplices.

Exceptions

  std::invalid_argument | In debug mode, if the complex_source is invalid.

## print_hasse()

template<typename SimplexTreeOptions = Simplex_tree_options_default>

void Gudhi::Simplex_tree< SimplexTreeOptions >::print_hasse | ( | std::ostream & | os | ) | const

inline

Write the hasse diagram of the simplicial complex in os.

Each row in the file correspond to a simplex. A line is written: dim idx_1 ... idx_k fil where dim is the dimension of the simplex, idx_1 ... idx_k are the row index (starting from 0) of the simplices of the boundary of the simplex, and fil is its filtration value.

Note
  Not thread safe

## prune_above_dimension()

template<typename SimplexTreeOptions = Simplex_tree_options_default>

bool Gudhi::Simplex_tree< SimplexTreeOptions >::prune_above_dimension | ( | int | dimension | ) |

inline

Remove all simplices of dimension greater than a given value.

Parameters

  [in] | dimension | Maximum dimension value.

Returns
  True if any simplex was removed, false if all simplices already had a value below the dimension.

## prune_above_filtration()

template<typename SimplexTreeOptions = Simplex_tree_options_default>

bool Gudhi::Simplex_tree< SimplexTreeOptions >::prune_above_filtration | ( | Filtration_value | filtration | ) |

inline

Prune above filtration value given as parameter.

Parameters

  [in] | filtration | Maximum threshold value.

Returns
  True if any simplex was removed, false if all simplices already had a value below the threshold.

Postcondition
  Note that the dimension of the simplicial complex may be lower after calling prune_above_filtration() than it was before. However, upper_bound_dimension() will return the old value, which remains a valid upper bound. If you care, you can call dimension() to recompute the exact dimension.

## remove_maximal_simplex()

template<typename SimplexTreeOptions = Simplex_tree_options_default>

void Gudhi::Simplex_tree< SimplexTreeOptions >::remove_maximal_simplex | ( | Simplex_handle | sh | ) |

inline

Remove a maximal simplex.

Parameters

  [in] | sh | Simplex handle on the maximal simplex to remove.

Precondition
  Please check the simplex has no coface before removing it.

Exceptions

  std::invalid_argument | In debug mode, if sh has children.

Postcondition
  Note that the dimension of the simplicial complex may be lower after calling remove_maximal_simplex() than it was before. However, upper_bound_dimension() will return the old value, which remains a valid upper bound. If you care, you can call dimension() to recompute the exact dimension.

## reset_filtration()

template<typename SimplexTreeOptions = Simplex_tree_options_default>

void Gudhi::Simplex_tree< SimplexTreeOptions >::reset_filtration | ( | Filtration_value | filt_value,
|  | int | min_dim = 0 )

inline

This function resets the filtration value of all the simplices of dimension at least min_dim. Resets all the Simplex_tree when min_dim = 0. reset_filtration may break the filtration property with min_dim > 0, and it is the user's responsibility to make it a valid filtration (using a large enough filt_value, or calling make_filtration_non_decreasing afterwards for instance).

Parameters

  [in] | filt_value | The new filtration value.
  [in] | min_dim | The minimal dimension. Default value is 0.

## root() [1/2]

template<typename SimplexTreeOptions = Simplex_tree_options_default>

Siblings * Gudhi::Simplex_tree< SimplexTreeOptions >::root | ( |  | ) |

inline

Returns a pointer to the root nodes of the simplex tree.

## root() [2/2]

template<typename SimplexTreeOptions = Simplex_tree_options_default>

const Siblings * Gudhi::Simplex_tree< SimplexTreeOptions >::root | ( |  | ) | const

inline

Returns a pointer to the root nodes of the simplex tree.

## self_siblings() [1/2]

template<typename SimplexTreeOptions = Simplex_tree_options_default>
template<class SimplexHandle>

Siblings * Gudhi::Simplex_tree< SimplexTreeOptions >::self_siblings | ( | SimplexHandle | sh | ) |

inline

Returns the Siblings containing a simplex.

## self_siblings() [2/2]

template<typename SimplexTreeOptions = Simplex_tree_options_default>
template<class SimplexHandle>

Siblings const * Gudhi::Simplex_tree< SimplexTreeOptions >::self_siblings | ( | SimplexHandle | sh | ) | const

inline

Returns the Siblings containing a simplex.

## set_dimension()

template<typename SimplexTreeOptions = Simplex_tree_options_default>

void Gudhi::Simplex_tree< SimplexTreeOptions >::set_dimension | ( | int | dimension,
|  | bool | exact = true )

inline

Set a dimension for the simplicial complex.

If exact is false, dimension is only an upper bound on the dimension of the complex. This function must be used with caution because it disables or limits the on-demand recomputation of the dimension (the need for recomputation can be caused by remove_maximal_simplex() or prune_above_filtration()).

## simplex()

template<typename SimplexTreeOptions = Simplex_tree_options_default>

Simplex_handle Gudhi::Simplex_tree< SimplexTreeOptions >::simplex | ( | Simplex_key | idx | ) | const

inline

Returns the simplex that has index idx in the filtration.

The filtration must be initialized.

Note
  Not thread safe

## simplex_vertex_range()

template<typename SimplexTreeOptions = Simplex_tree_options_default>

Simplex_vertex_range Gudhi::Simplex_tree< SimplexTreeOptions >::simplex_vertex_range | ( | Simplex_handle | sh | ) | const

inline

Returns a range over the vertices of a simplex.

The order in which the vertices are visited is the decreasing order for < on Vertex_handles, which is consequently equal to \((-1)^{\text{dim} \sigma}\) the canonical orientation on the simplex.

Examples
  Alpha_complex_3d_from_points.cpp, Alpha_complex_from_off.cpp, Alpha_complex_from_points.cpp, CoordGIC.cpp, Fast_alpha_complex_from_off.cpp, FuncGIC.cpp, Nerve.cpp, VoronoiGIC.cpp, Weighted_alpha_complex_3d_from_points.cpp, and Weighted_alpha_complex_from_points.cpp.

## skeleton_simplex_range()

template<typename SimplexTreeOptions = Simplex_tree_options_default>

Skeleton_simplex_range Gudhi::Simplex_tree< SimplexTreeOptions >::skeleton_simplex_range | ( | int | dim | ) | const

inline

Returns a range over the simplices of the dim-skeleton of the simplicial complex.

The \(d\)-skeleton of a simplicial complex \(\mathbf{K}\) is the simplicial complex containing the simplices of \(\mathbf{K}\) of dimension at most \(d\).

Parameters

  [in] | dim | The maximal dimension of the simplices in the skeleton.

The simplices are ordered according to lexicographic order on the list of Vertex_handles of a simplex, read in increasing < order for Vertex_handles.

## star_simplex_range()

template<typename SimplexTreeOptions = Simplex_tree_options_default>

Cofaces_simplex_range Gudhi::Simplex_tree< SimplexTreeOptions >::star_simplex_range | ( | const Simplex_handle | simplex | ) | const

inline

Compute the star of a n simplex.

Parameters

  simplex | represent the simplex of which we search the star

Returns
  Vector of Simplex_tree::Simplex_handle (empty vector if no star found) when SimplexTreeOptions::link_nodes_by_label is false.

Simplex_tree::Simplex_handle range for an optimized search for the star of a simplex when SimplexTreeOptions::link_nodes_by_label is true.

## upper_bound_dimension()

template<typename SimplexTreeOptions = Simplex_tree_options_default>

int Gudhi::Simplex_tree< SimplexTreeOptions >::upper_bound_dimension | ( |  | ) | const

inline

Returns an upper bound on the dimension of the simplicial complex.

Note
  Not thread safe

## vertex_with_same_filtration()

template<typename SimplexTreeOptions = Simplex_tree_options_default>

Vertex_handle Gudhi::Simplex_tree< SimplexTreeOptions >::vertex_with_same_filtration | ( | Simplex_handle | sh | ) | const

inline

Returns a vertex of sh that has the same filtration value as sh if it exists, and null_vertex() otherwise.

For a lower-star filtration built with make_filtration_non_decreasing(), this is a way to invert the process and find out which vertex had its filtration value propagated to sh. If several vertices have the same filtration value, the one it returns is arbitrary.

The documentation for this class was generated from the following file:

- include/gudhi/Simplex_tree.h