Structural Bioinformatics Library
Template C++ / Python API for developping structural bioinformatics applications.
T_Hierarchical_labels_forest< MolecularSystemLabelsTraits > Class Template Reference

Provides a forest structure associated to the labels defined in MolecularSystemLabelsTraits . More...

#include <Hierarchical_labels_forest.hpp>

Public Types

typedef MolecularSystemLabelsTraits::Label Label
 System's label that can be either a partner, a mediator or a extra label.
typedef boost::transform_iterator< Get_label_of_vertex, Vertices_iterator > Labels_iterator
 Iterator over the labels of the forest.
typedef boost::transform_iterator< Get_label_of_vertex, Minimal_elements_iterator > Primitive_labels_iterator
 Iterator over the primitive labels of the forest.
typedef boost::transform_iterator< Get_label_of_vertex, Maximal_elements_iterator > Root_labels_iterator
 Iterator over the primitive labels of the forest.
typedef boost::transform_iterator< Get_label_of_vertex, Descendant_minimal_elements_iterator > Descendant_primitive_labels_iterator
 Iterator over all primitive labels descendant of a given label.
typedef boost::transform_iterator< Get_label_of_vertex, Hierarchical_vertices_iterator > Hierarchical_labels_iterator
 Iterator over all hierarchical labels.

Constructors

 T_Hierarchical_labels_forest (void)
 It constructs automatically the forest from the labels defined in MolecularSystemLabelsTraits.

Accessors

const Directed_acyclic_graphget_directed_acyclic_graph (void) const
unsigned get_num_of_primitive_label (Label label) const
 Get the number of a primitive label among all primitive labels.
Label get_primitive_label_from_num (unsigned n) const
 Get the nth primitive label among all primitive labels.

Queries

bool is_primitive_label (Label label) const
 Check that a label is primitive.
bool is_ancestor (Label label_1, Label label_2) const
 Check that label_1 is an ancestor of label_2.

Traversals

Labels_iterator labels_begin (void) const
 Starts the set of labels.
Labels_iterator labels_end (void) const
 Terminates the set of labels.
Primitive_labels_iterator primitive_labels_begin (void) const
 Starts the set of primitive labels.
Primitive_labels_iterator primitive_labels_end (void) const
 Terminates the set of primitive labels.
Descendant_primitive_labels_iterator primitive_labels_begin (Label label) const
 Starts the set of primitive labels equal or having as parent the input label.
Descendant_primitive_labels_iterator primitive_labels_end (Label label) const
 Terminates the set of primitive labels equal or having as parent the input label.
Hierarchical_labels_iterator hierarchical_labels_begin (void) const
 Starts the set of hierarchical labels.
Hierarchical_labels_iterator hierarchical_labels_end (void) const
 Terminates the set of hierarchical labels.
Root_labels_iterator root_labels_begin (void) const
 Starts the set of hierarchical labels.
Root_labels_iterator root_labels_end (void) const
 Terminates the set of hierarchical labels.

Detailed Description

template<class MolecularSystemLabelsTraits>
class SBL::CSB::T_Hierarchical_labels_forest< MolecularSystemLabelsTraits >

Provides a forest structure associated to the labels defined in MolecularSystemLabelsTraits .

Template Parameters
MolecularSystemLabelsTraitsDefinition of types related to labels, as the MolecularSystemLabelsTraits concept.

Member Typedef Documentation

◆ Descendant_primitive_labels_iterator

template<class MolecularSystemLabelsTraits>
typedef boost::transform_iterator<Get_label_of_vertex, Descendant_minimal_elements_iterator> Descendant_primitive_labels_iterator

Iterator over all primitive labels descendant of a given label.

◆ Hierarchical_labels_iterator

template<class MolecularSystemLabelsTraits>
typedef boost::transform_iterator<Get_label_of_vertex, Hierarchical_vertices_iterator> Hierarchical_labels_iterator

Iterator over all hierarchical labels.

◆ Label

template<class MolecularSystemLabelsTraits>
typedef MolecularSystemLabelsTraits::Label Label

System's label that can be either a partner, a mediator or a extra label.

◆ Labels_iterator

template<class MolecularSystemLabelsTraits>
typedef boost::transform_iterator<Get_label_of_vertex, Vertices_iterator> Labels_iterator

Iterator over the labels of the forest.

◆ Primitive_labels_iterator

template<class MolecularSystemLabelsTraits>
typedef boost::transform_iterator<Get_label_of_vertex, Minimal_elements_iterator> Primitive_labels_iterator

Iterator over the primitive labels of the forest.

◆ Root_labels_iterator

template<class MolecularSystemLabelsTraits>
typedef boost::transform_iterator<Get_label_of_vertex, Maximal_elements_iterator> Root_labels_iterator

Iterator over the primitive labels of the forest.

Constructor & Destructor Documentation

◆ T_Hierarchical_labels_forest()

template<class MolecularSystemLabelsTraits>
T_Hierarchical_labels_forest ( void )
inline

It constructs automatically the forest from the labels defined in MolecularSystemLabelsTraits.

Member Function Documentation

◆ get_directed_acyclic_graph()

template<class MolecularSystemLabelsTraits>
const T_Hierarchical_labels_forest< MolecularSystemLabelsTraits >::Directed_acyclic_graph & get_directed_acyclic_graph ( void ) const
inline

Access to the DAG representing the forest.

◆ get_num_of_primitive_label()

template<class MolecularSystemLabelsTraits>
unsigned get_num_of_primitive_label ( Label label) const
inline

Get the number of a primitive label among all primitive labels.

This is used to map the primitive labels to consecutive indices from 0.

Precondition
label is primitive.

◆ get_primitive_label_from_num()

template<class MolecularSystemLabelsTraits>
T_Hierarchical_labels_forest< MolecularSystemLabelsTraits >::Label get_primitive_label_from_num ( unsigned n) const
inline

Get the nth primitive label among all primitive labels.

This is used to map consecutive indices from 0 to primitive labels.

Precondition
n is less than the number of primitive labels.

◆ hierarchical_labels_begin()

template<class MolecularSystemLabelsTraits>
T_Hierarchical_labels_forest< MolecularSystemLabelsTraits >::Hierarchical_labels_iterator hierarchical_labels_begin ( void ) const
inline

Starts the set of hierarchical labels.

◆ hierarchical_labels_end()

template<class MolecularSystemLabelsTraits>
T_Hierarchical_labels_forest< MolecularSystemLabelsTraits >::Hierarchical_labels_iterator hierarchical_labels_end ( void ) const
inline

Terminates the set of hierarchical labels.

◆ is_ancestor()

template<class MolecularSystemLabelsTraits>
bool is_ancestor ( Label label_1,
Label label_2 ) const
inline

Check that label_1 is an ancestor of label_2.

◆ is_primitive_label()

template<class MolecularSystemLabelsTraits>
bool is_primitive_label ( Label label) const
inline

Check that a label is primitive.

◆ labels_begin()

template<class MolecularSystemLabelsTraits>
T_Hierarchical_labels_forest< MolecularSystemLabelsTraits >::Labels_iterator labels_begin ( void ) const
inline

Starts the set of labels.

◆ labels_end()

template<class MolecularSystemLabelsTraits>
T_Hierarchical_labels_forest< MolecularSystemLabelsTraits >::Labels_iterator labels_end ( void ) const
inline

Terminates the set of labels.

◆ primitive_labels_begin() [1/2]

template<class MolecularSystemLabelsTraits>
T_Hierarchical_labels_forest< MolecularSystemLabelsTraits >::Descendant_primitive_labels_iterator primitive_labels_begin ( Label label) const
inline

Starts the set of primitive labels equal or having as parent the input label.

◆ primitive_labels_begin() [2/2]

template<class MolecularSystemLabelsTraits>
T_Hierarchical_labels_forest< MolecularSystemLabelsTraits >::Primitive_labels_iterator primitive_labels_begin ( void ) const
inline

Starts the set of primitive labels.

◆ primitive_labels_end() [1/2]

template<class MolecularSystemLabelsTraits>
T_Hierarchical_labels_forest< MolecularSystemLabelsTraits >::Descendant_primitive_labels_iterator primitive_labels_end ( Label label) const
inline

Terminates the set of primitive labels equal or having as parent the input label.

◆ primitive_labels_end() [2/2]

template<class MolecularSystemLabelsTraits>
T_Hierarchical_labels_forest< MolecularSystemLabelsTraits >::Primitive_labels_iterator primitive_labels_end ( void ) const
inline

Terminates the set of primitive labels.

◆ root_labels_begin()

template<class MolecularSystemLabelsTraits>
T_Hierarchical_labels_forest< MolecularSystemLabelsTraits >::Root_labels_iterator root_labels_begin ( void ) const
inline

Starts the set of hierarchical labels.

◆ root_labels_end()

template<class MolecularSystemLabelsTraits>
T_Hierarchical_labels_forest< MolecularSystemLabelsTraits >::Root_labels_iterator root_labels_end ( void ) const
inline

Terminates the set of hierarchical labels.