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. More...
 

Constructors / Destructors


 T_Morse_Smale_Witten_chain_complex ()
 
 T_Morse_Smale_Witten_chain_complex (Morse_function &function)
 
 ~T_Morse_Smale_Witten_chain_complex ()
 

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. More...
 
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. More...
 
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. More...
 
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. More...
 
void remove_connected_component (Critical_vertex u)
 Removes all critical vertices in the complex that are in the same connected component as u. More...
 
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. More...
 

Traversal


void set_skip_saddle_SM_switch (bool skip_saddle_SM)
 
Critical_vertices_iterator critical_vertices_begin (void) const
 Starts the set of all critical vertices. More...
 
Critical_vertices_iterator critical_vertices_end (void) const
 Ends the set of all critical vertices. More...
 
Critical_vertices_of_same_index_iterator critical_vertices_begin (Morse_index_type k) const
 Starts the set of critical vertices of index k. More...
 
Critical_vertices_of_same_index_iterator critical_vertices_end (Morse_index_type k) const
 Ends the set of critical vertices of index k. More...
 
Faces_iterator faces_begin (Critical_vertex u) const
 Starts the set of faces of u, that are incident critical vertices of higher index. More...
 
Faces_iterator faces_end (Critical_vertex u) const
 Ends the set of faces of u, that are incident critical vertices of higher index. More...
 
Cofaces_iterator cofaces_begin (Critical_vertex u) const
 Starts the set of cofaces of u, that are incident critical vertices of lower index. More...
 
Cofaces_iterator cofaces_end (Critical_vertex u) const
 Ends the set of cofaces of u, that are incident critical vertices of lower index. More...
 
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. More...
 
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. More...
 

Combinatorial


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

Stable Manifolds


void add_point_to_stable_manifold (const Point &p, Critical_vertex u)
 Adds p to the stable manifold of u. More...
 
Stable_manifold & get_stable_manifold (Critical_vertex u)
 Returns the stable manifold of u. More...
 
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. More...
 
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. More...
 

Morse Function


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

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

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]

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]

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()

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()

void add_point_to_stable_manifold ( const Point &  p,
Critical_vertex  u 
)
inline

Adds p to the stable manifold of u.

◆ cancel_pair()

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()

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()

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()

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]

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]

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]

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]

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()

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()

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]

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]

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()

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()

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()

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()

MorseFunction & get_Morse_function ( void  )
inline

Returns the associated function as a functor.

◆ get_Morse_function_value() [1/2]

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]

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()

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()

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]

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]

unsigned get_number_of_critical_vertices ( void  ) const
inline

Returns the number of vertices.

◆ get_number_of_faces()

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()

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()

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()

bool is_abstract_critical_vertex ( Critical_vertex  u) const
inline

Returns true iff there is no associated point to u.

◆ is_face_of()

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()

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()

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()

void set_Morse_function ( Morse_function &  function)
inline

Sets the Morse function of the complex.

Precondition
Only callable if the underlying DAG is empty.