Structural Bioinformatics Library
Template C++ / Python API for developping structural bioinformatics applications.
T_Morse_Smale_Witten_chain_complex< MorseFunction, StableManifoldTraits > Class Template Reference

Representation of the complex of the same name. More...

#include <Morse_Smale_Witten_chain_complex.hpp>

Public Types

typedef StableManifoldTraits Stable_manifold_traits
 Simple representation of a stable manifold as a list of points.

Manipulation

Critical_vertex add_critical_vertex (const Point &p, Morse_index_type k)
 Adds a critical vertex of index k associated to the input point p.
Critical_vertex add_abstract_critical_vertex (const FT &lower_bound, Morse_index_type k)
 Adds a critical vertex of index k that has no critical point, and a lower bound for its Morse function value.
Critical_vertex add_abstract_critical_vertex (Morse_index_type k)
 Adds a critical vertex of index k that has no critical point, and no defined lower bound for its Morse function value.
void connect_critical_vertices (Critical_vertex u, Critical_vertex v)
 Connects u and v such that u is one index higher than v. If u is purely abstract, its lower bound is updated from the value of v.
void remove_connected_component (Critical_vertex u)
 Removes all critical vertices in the complex that are in the same connected component as u.
void cancel_pair (Critical_vertex u, Critical_vertex v)
 Simplifies the chain complex by cancelling the pair (u, v), where u is a face of v.

Traversal

Critical_vertices_iterator critical_vertices_begin (void) const
 Starts the set of all critical vertices.
Critical_vertices_iterator critical_vertices_end (void) const
 Ends the set of all critical vertices.
Critical_vertices_of_same_index_iterator critical_vertices_begin (Morse_index_type k) const
 Starts the set of critical vertices of index k.
Critical_vertices_of_same_index_iterator critical_vertices_end (Morse_index_type k) const
 Ends the set of critical vertices of index k.
Faces_iterator faces_begin (Critical_vertex u) const
 Starts the set of faces of u, that are incident critical vertices of higher index.
Faces_iterator faces_end (Critical_vertex u) const
 Ends the set of faces of u, that are incident critical vertices of higher index.
Cofaces_iterator cofaces_begin (Critical_vertex u) const
 Starts the set of cofaces of u, that are incident critical vertices of lower index.
Cofaces_iterator cofaces_end (Critical_vertex u) const
 Ends the set of cofaces of u, that are incident critical vertices of lower index.
template<class OutputIterator>
OutputIterator get_common_cofaces (Critical_vertex u, Critical_vertex v, OutputIterator out) const
 Returns the common cofaces of u and v, sharing the same index.
template<class InputIterator, class OutputIterator>
OutputIterator get_common_cofaces (InputIterator begin, InputIterator end, OutputIterator out) const
 Returns the common cofaces of the input critical vertices, sharing the same index.

Combinatorial

const Directed_acyclic_graphget_directed_acyclic_graph (void) const
 Returns the data structure ofthe chain complex, that is a directed acyclic graph.
const Point & get_critical_point (Critical_vertex u)
 Returns the point associated to u, a non-abstract vertex.
Morse_index_type get_Morse_index (Critical_vertex u) const
 Returns the index of a critical vertex.
bool is_abstract_critical_vertex (Critical_vertex u) const
 Returns true iff there is no associated point to u.
bool is_pure_abstract_critical_vertex (Critical_vertex u) const
 Returns true iff there is no associated point to u and no lower bound.
unsigned get_number_of_critical_vertices (void) const
 Returns the number of vertices.
unsigned get_number_of_critical_vertices (Morse_index_type k) const
 Returns the number of vertices wof index k.
bool is_face_of (Critical_vertex u, Critical_vertex v) const
 Checks that u and v are incident, and that the index of v is higher than the index u.
unsigned get_number_of_faces (Critical_vertex u) const
 Returns the number of incident vertices of u with a higher index.
unsigned get_number_of_cofaces (Critical_vertex u) const
 Returns the number of incident vertices of u with a lower index.

Stable Manifolds

void add_point_to_stable_manifold (const Point &p, Critical_vertex u)
 Adds p to the stable manifold of u.
Stable_manifold & get_stable_manifold (Critical_vertex u)
 Returns the stable manifold of u.
FT get_lower_bound_of_stable_manifold (Critical_vertex u)
 Returns the lower bound of the stable manifold of u. When u is purely abstract and has no point in its stable manifold, its lower bound is estimated from its faces.
FT get_upper_bound_of_stable_manifold (Critical_vertex u)
 Returns the upper bound of the stable manifold of u when u is not purely abstract or its stable manifold has at least one point; returns its lower bound otherwise.

Morse Function

Morse_function & get_Morse_function (void)
 Returns the associated function as a functor.
void set_Morse_function (Morse_function &function)
 Sets the Morse function of the complex.
FT get_Morse_function_value (const Point &p)
 Returns the value of a point.
FT get_Morse_function_value (Critical_vertex u)
 Returns the value of a vertex.

Detailed Description

template<class MorseFunction, class StableManifoldTraits = T_Stable_manifold_as_list_traits<typename MorseFunction::Point>>
class SBL::GT::T_Morse_Smale_Witten_chain_complex< MorseFunction, StableManifoldTraits >

Representation of the complex of the same name.

Template Parameters
MorseFunctionis a functor that return the height of a sample and the gradient of two samples. Note that it has to define the number type FT it uses for returning a value, and the type Point it uses as input.
StableManifoldTraitsTraits class defining types and static methods on a stable manifold.

Member Typedef Documentation

◆ Stable_manifold_traits

template<class MorseFunction, class StableManifoldTraits = T_Stable_manifold_as_list_traits<typename MorseFunction::Point>>
typedef StableManifoldTraits Stable_manifold_traits

Simple representation of a stable manifold as a list of points.

Template Parameters
PointType of points in the stable manifold.

Member Function Documentation

◆ add_abstract_critical_vertex() [1/2]

template<class MorseFunction, class StableManifoldTraits>
T_Morse_Smale_Witten_chain_complex< MorseFunction, StableManifoldTraits >::Critical_vertex add_abstract_critical_vertex ( const FT & lower_bound,
Morse_index_type k )
inline

Adds a critical vertex of index k that has no critical point, and a lower bound for its Morse function value.

◆ add_abstract_critical_vertex() [2/2]

template<class MorseFunction, class StableManifoldTraits>
T_Morse_Smale_Witten_chain_complex< MorseFunction, StableManifoldTraits >::Critical_vertex add_abstract_critical_vertex ( Morse_index_type k)
inline

Adds a critical vertex of index k that has no critical point, and no defined lower bound for its Morse function value.

◆ add_critical_vertex()

template<class MorseFunction, class StableManifoldTraits>
T_Morse_Smale_Witten_chain_complex< MorseFunction, StableManifoldTraits >::Critical_vertex add_critical_vertex ( const Point & p,
Morse_index_type k )
inline

Adds a critical vertex of index k associated to the input point p.

◆ add_point_to_stable_manifold()

template<class MorseFunction, class StableManifoldTraits>
void add_point_to_stable_manifold ( const Point & p,
Critical_vertex u )
inline

Adds p to the stable manifold of u.

◆ cancel_pair()

template<class MorseFunction, class StableManifoldTraits>
void cancel_pair ( Critical_vertex u,
Critical_vertex v )
inline

Simplifies the chain complex by cancelling the pair (u, v), where u is a face of v.

◆ cofaces_begin()

template<class MorseFunction, class StableManifoldTraits>
T_Morse_Smale_Witten_chain_complex< MorseFunction, StableManifoldTraits >::Cofaces_iterator cofaces_begin ( Critical_vertex u) const
inline

Starts the set of cofaces of u, that are incident critical vertices of lower index.

◆ cofaces_end()

template<class MorseFunction, class StableManifoldTraits>
T_Morse_Smale_Witten_chain_complex< MorseFunction, StableManifoldTraits >::Cofaces_iterator cofaces_end ( Critical_vertex u) const
inline

Ends the set of cofaces of u, that are incident critical vertices of lower index.

◆ connect_critical_vertices()

template<class MorseFunction, class StableManifoldTraits>
void connect_critical_vertices ( Critical_vertex u,
Critical_vertex v )
inline

Connects u and v such that u is one index higher than v. If u is purely abstract, its lower bound is updated from the value of v.

◆ critical_vertices_begin() [1/2]

template<class MorseFunction, class StableManifoldTraits>
T_Morse_Smale_Witten_chain_complex< MorseFunction, StableManifoldTraits >::Critical_vertices_of_same_index_iterator critical_vertices_begin ( Morse_index_type k) const
inline

Starts the set of critical vertices of index k.

◆ critical_vertices_begin() [2/2]

template<class MorseFunction, class StableManifoldTraits>
T_Morse_Smale_Witten_chain_complex< MorseFunction, StableManifoldTraits >::Critical_vertices_iterator critical_vertices_begin ( void ) const
inline

Starts the set of all critical vertices.

◆ critical_vertices_end() [1/2]

template<class MorseFunction, class StableManifoldTraits>
T_Morse_Smale_Witten_chain_complex< MorseFunction, StableManifoldTraits >::Critical_vertices_of_same_index_iterator critical_vertices_end ( Morse_index_type k) const
inline

Ends the set of critical vertices of index k.

◆ critical_vertices_end() [2/2]

template<class MorseFunction, class StableManifoldTraits>
T_Morse_Smale_Witten_chain_complex< MorseFunction, StableManifoldTraits >::Critical_vertices_iterator critical_vertices_end ( void ) const
inline

Ends the set of all critical vertices.

◆ faces_begin()

template<class MorseFunction, class StableManifoldTraits>
T_Morse_Smale_Witten_chain_complex< MorseFunction, StableManifoldTraits >::Faces_iterator faces_begin ( Critical_vertex u) const
inline

Starts the set of faces of u, that are incident critical vertices of higher index.

◆ faces_end()

template<class MorseFunction, class StableManifoldTraits>
T_Morse_Smale_Witten_chain_complex< MorseFunction, StableManifoldTraits >::Faces_iterator faces_end ( Critical_vertex u) const
inline

Ends the set of faces of u, that are incident critical vertices of higher index.

◆ get_common_cofaces() [1/2]

template<class MorseFunction, class StableManifoldTraits>
template<class OutputIterator>
OutputIterator get_common_cofaces ( Critical_vertex u,
Critical_vertex v,
OutputIterator out ) const
inline

Returns the common cofaces of u and v, sharing the same index.

◆ get_common_cofaces() [2/2]

template<class MorseFunction, class StableManifoldTraits>
template<class InputIterator, class OutputIterator>
OutputIterator get_common_cofaces ( InputIterator begin,
InputIterator end,
OutputIterator out ) const
inline

Returns the common cofaces of the input critical vertices, sharing the same index.

◆ get_critical_point()

template<class MorseFunction, class StableManifoldTraits>
const T_Morse_Smale_Witten_chain_complex< MorseFunction, StableManifoldTraits >::Point & get_critical_point ( Critical_vertex u)
inline

Returns the point associated to u, a non-abstract vertex.

◆ get_directed_acyclic_graph()

template<class MorseFunction, class StableManifoldTraits>
const T_Morse_Smale_Witten_chain_complex< MorseFunction, StableManifoldTraits >::Directed_acyclic_graph & get_directed_acyclic_graph ( void ) const
inline

Returns the data structure ofthe chain complex, that is a directed acyclic graph.

◆ get_lower_bound_of_stable_manifold()

template<class MorseFunction, class StableManifoldTraits>
T_Morse_Smale_Witten_chain_complex< MorseFunction, StableManifoldTraits >::FT get_lower_bound_of_stable_manifold ( Critical_vertex u)
inline

Returns the lower bound of the stable manifold of u. When u is purely abstract and has no point in its stable manifold, its lower bound is estimated from its faces.

◆ get_Morse_function()

template<class MorseFunction, class StableManifoldTraits>
MorseFunction & get_Morse_function ( void )
inline

Returns the associated function as a functor.

◆ get_Morse_function_value() [1/2]

template<class MorseFunction, class StableManifoldTraits>
T_Morse_Smale_Witten_chain_complex< MorseFunction, StableManifoldTraits >::FT get_Morse_function_value ( const Point & p)
inline

Returns the value of a point.

◆ get_Morse_function_value() [2/2]

template<class MorseFunction, class StableManifoldTraits>
T_Morse_Smale_Witten_chain_complex< MorseFunction, StableManifoldTraits >::FT get_Morse_function_value ( Critical_vertex u)
inline

Returns the value of a vertex.

◆ get_Morse_index()

template<class MorseFunction, class StableManifoldTraits>
T_Morse_Smale_Witten_chain_complex< MorseFunction, StableManifoldTraits >::Morse_index_type get_Morse_index ( Critical_vertex u) const
inline

Returns the index of a critical vertex.

◆ get_number_of_cofaces()

template<class MorseFunction, class StableManifoldTraits>
unsigned get_number_of_cofaces ( Critical_vertex u) const
inline

Returns the number of incident vertices of u with a lower index.

◆ get_number_of_critical_vertices() [1/2]

template<class MorseFunction, class StableManifoldTraits>
unsigned get_number_of_critical_vertices ( Morse_index_type k) const
inline

Returns the number of vertices wof index k.

◆ get_number_of_critical_vertices() [2/2]

template<class MorseFunction, class StableManifoldTraits>
unsigned get_number_of_critical_vertices ( void ) const
inline

Returns the number of vertices.

◆ get_number_of_faces()

template<class MorseFunction, class StableManifoldTraits>
unsigned get_number_of_faces ( Critical_vertex u) const
inline

Returns the number of incident vertices of u with a higher index.

◆ get_stable_manifold()

template<class MorseFunction, class StableManifoldTraits>
T_Morse_Smale_Witten_chain_complex< MorseFunction, StableManifoldTraits >::Stable_manifold & get_stable_manifold ( Critical_vertex u)
inline

Returns the stable manifold of u.

◆ get_upper_bound_of_stable_manifold()

template<class MorseFunction, class StableManifoldTraits>
T_Morse_Smale_Witten_chain_complex< MorseFunction, StableManifoldTraits >::FT get_upper_bound_of_stable_manifold ( Critical_vertex u)
inline

Returns the upper bound of the stable manifold of u when u is not purely abstract or its stable manifold has at least one point; returns its lower bound otherwise.

◆ is_abstract_critical_vertex()

template<class MorseFunction, class StableManifoldTraits>
bool is_abstract_critical_vertex ( Critical_vertex u) const
inline

Returns true iff there is no associated point to u.

◆ is_face_of()

template<class MorseFunction, class StableManifoldTraits>
bool is_face_of ( Critical_vertex u,
Critical_vertex v ) const
inline

Checks that u and v are incident, and that the index of v is higher than the index u.

◆ is_pure_abstract_critical_vertex()

template<class MorseFunction, class StableManifoldTraits>
bool is_pure_abstract_critical_vertex ( Critical_vertex u) const
inline

Returns true iff there is no associated point to u and no lower bound.

◆ remove_connected_component()

template<class MorseFunction, class StableManifoldTraits>
void remove_connected_component ( Critical_vertex u)
inline

Removes all critical vertices in the complex that are in the same connected component as u.

◆ set_Morse_function()

template<class MorseFunction, class StableManifoldTraits>
void set_Morse_function ( Morse_function & function)
inline

Sets the Morse function of the complex.

Precondition
Only callable if the underlying DAG is empty.