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>

Classes

class  Get_label_of_vertex
 
class  Is_child_of_label
 
class  Is_child_or_equal_label
 
class  Is_hierarchical_label
 
class  Label_property
 

Public Types

typedef T_Hierarchical_labels_forest< MolecularSystemLabelsTraits > Self
 
typedef MolecularSystemLabelsTraits::Label Label
 System's label that can be either a partner, a mediator or a extra label. More...
 
typedef boost::transform_iterator< Get_label_of_vertex, Vertices_iteratorLabels_iterator
 Iterator over the labels of the forest. More...
 
typedef boost::transform_iterator< Get_label_of_vertex, Minimal_elements_iteratorPrimitive_labels_iterator
 Iterator over the primitive labels of the forest. More...
 
typedef boost::transform_iterator< Get_label_of_vertex, Maximal_elements_iteratorRoot_labels_iterator
 Iterator over the primitive labels of the forest. More...
 
typedef boost::transform_iterator< Get_label_of_vertex, Descendant_minimal_elements_iteratorDescendant_primitive_labels_iterator
 Iterator over all primitive labels descendant of a given label. More...
 
typedef boost::transform_iterator< Get_label_of_vertex, Hierarchical_vertices_iteratorHierarchical_labels_iterator
 Iterator over all hierarchical labels. More...
 

Public Structures

typedef CADS::T_Directed_acyclic_graph< Label_propertyDirected_acyclic_graph
 
typedef Directed_acyclic_graph::Vertex Vertex
 
typedef Directed_acyclic_graph::Vertices_iterator Vertices_iterator
 
typedef Directed_acyclic_graph::Minimal_elements_iterator Minimal_elements_iterator
 
typedef Directed_acyclic_graph::Maximal_elements_iterator Maximal_elements_iterator
 
typedef boost::filter_iterator< Is_child_or_equal_label, Minimal_elements_iteratorDescendant_minimal_elements_iterator
 
typedef boost::filter_iterator< Is_hierarchical_label, Vertices_iteratorHierarchical_vertices_iterator
 

Constructors

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

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. More...
 
Label get_primitive_label_from_num (unsigned n) const
 Get the nth primitive label among all primitive labels. More...
 
unsigned get_number_of_roots (void) const
 

Queries

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

Traversals

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

I/O

template<class OutputStream >
void print_in_dot_format (OutputStream &out) const
 
void print_in_dot_format (void) const
 

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_minimal_elements_iterator

◆ Descendant_primitive_labels_iterator

Iterator over all primitive labels descendant of a given label.

◆ Directed_acyclic_graph

◆ Hierarchical_labels_iterator

Iterator over all hierarchical labels.

◆ Hierarchical_vertices_iterator

◆ Label

typedef MolecularSystemLabelsTraits::Label Label

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

◆ Labels_iterator

typedef boost::transform_iterator<Get_label_of_vertex, Vertices_iterator> Labels_iterator

Iterator over the labels of the forest.

◆ Maximal_elements_iterator

typedef Directed_acyclic_graph:: Maximal_elements_iterator Maximal_elements_iterator

◆ Minimal_elements_iterator

typedef Directed_acyclic_graph:: Minimal_elements_iterator Minimal_elements_iterator

◆ Primitive_labels_iterator

Iterator over the primitive labels of the forest.

◆ Root_labels_iterator

Iterator over the primitive labels of the forest.

◆ Self

typedef T_Hierarchical_labels_forest<MolecularSystemLabelsTraits> Self

◆ Vertex

◆ Vertices_iterator

Constructor & Destructor Documentation

◆ T_Hierarchical_labels_forest()

T_Hierarchical_labels_forest ( void  )
inline

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

Member Function Documentation

◆ get_directed_acyclic_graph()

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

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

unsigned get_number_of_roots ( void  ) const
inline

◆ get_primitive_label_from_num()

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

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

Starts the set of hierarchical labels.

◆ hierarchical_labels_end()

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

Terminates the set of hierarchical labels.

◆ is_ancestor()

bool is_ancestor ( Label  label_1,
Label  label_2 
) const
inline

Check that label_1 is an ancestor of label_2.

◆ is_primitive_label()

bool is_primitive_label ( Label  label) const
inline

Check that a label is primitive.

◆ labels_begin()

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

Starts the set of labels.

◆ labels_end()

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

Terminates the set of labels.

◆ primitive_labels_begin() [1/2]

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]

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]

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]

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

Terminates the set of primitive labels.

◆ print_in_dot_format() [1/2]

void print_in_dot_format ( OutputStream &  out) const
inline

◆ print_in_dot_format() [2/2]

void print_in_dot_format ( void  ) const
inline

◆ root_labels_begin()

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

Starts the set of hierarchical labels.

◆ root_labels_end()

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

Terminates the set of hierarchical labels.