|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Construye índices de nodos y arcos para su rápida búsqueda y recuperación. More...
#include <tpl_indexGraph.H>
Public Member Functions | |
| Index_Graph (GT &g) | |
| Crea un índice del grafo: los nodos y arcos son indizados. | |
| GT_Node * | insert_node (const GT_Node_Type &info) |
| Crea un nuevo nodo y lo inserta en grafo y en el índice. | |
| GT_Arc * | insert_arc (GT_Node *src, GT_Node *tgt, const GT_Arc_Type &info=GT_Arc_Type()) |
| Crea un nuevo arco entre dos nodos y lo inserta en el grafo y en el índice. | |
| GT_Node * | search_node (GT_Node *p) |
| Busca en el índice un nodo. | |
| GT_Node * | search_node (const GT_Node_Type &info) |
| Busca en el índice un nodo. | |
| GT_Arc * | search_arc (GT_Node *src, GT_Node *tgt) |
| Busca en el índice un arco dados dos nodos. | |
| void | remove_node (GT_Node *p) |
| Elimina el nodo p del grafo y del índice. | |
| void | remove_arc (GT_Arc *a) |
| Elimina del grafo y del índice el arco a. | |
| size_t | get_num_arcs () const |
| Retorna el número de arcos que contiene el índice. | |
| size_t | get_num_nodes () const |
| Retorna el número de nodos que contiene el índice. | |
Private Types | |
| typedef GT::Arc | GT_Arc |
| typedef GT::Node | GT_Node |
| typedef GT::Arc_Type | GT_Arc_Type |
| typedef GT::Node_Type | GT_Node_Type |
Private Attributes | |
| IndexNode< GT, Compare, Tree > | idx_node |
| IndexArc< GT, Tree > | idx_arc |
Construye índices de nodos y arcos para su rápida búsqueda y recuperación.
Index_Graph indiza los nodos y arcos a efectos de su recuperación rápida.
A efectos de facilitar el uso y hacer su uso más seguro, Index_Graph ofrece las operaciones topológicas clásicas de un grafo: insert_node(), insert_arc(), etc.
La clase recibe los siguientes parámetros tipo:
Por omisión esta clase está programada para comparar el valor retornado por get_info() sobre cada nodo. Para ello, el operador < del tipo GT::Node_Type debe estar implementado
Definition at line 118 of file tpl_indexGraph.H.
|
private |
Definition at line 122 of file tpl_indexGraph.H.
|
private |
Definition at line 124 of file tpl_indexGraph.H.
|
private |
Definition at line 123 of file tpl_indexGraph.H.
|
private |
Definition at line 125 of file tpl_indexGraph.H.
|
inline |
Crea un índice del grafo: los nodos y arcos son indizados.
Definition at line 133 of file tpl_indexGraph.H.
|
inline |
Retorna el número de arcos que contiene el índice.
Definition at line 229 of file tpl_indexGraph.H.
References Aleph::Index_Graph< GT, Compare, Tree >::idx_arc.
Referenced by TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), and TEST_F().
|
inline |
Retorna el número de nodos que contiene el índice.
Definition at line 232 of file tpl_indexGraph.H.
References Aleph::Index_Graph< GT, Compare, Tree >::idx_node.
Referenced by TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), and TEST_F().
|
inline |
Crea un nuevo arco entre dos nodos y lo inserta en el grafo y en el índice.
| [in] | src | nodo origen. |
| [in] | tgt | nodo destino. |
| [in] | info | información a copiarse en el arco. Por omisión es la que dé el constructor GT_Arc_Type(). |
| bad_alloc | si no hay suficiente memoria. |
Definition at line 159 of file tpl_indexGraph.H.
References ah_domain_error_if, Aleph::Index_Graph< GT, Compare, Tree >::idx_arc, Aleph::Index_Graph< GT, Compare, Tree >::idx_node, and Aleph::maps().
Referenced by main(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), and TEST_F().
|
inline |
Crea un nuevo nodo y lo inserta en grafo y en el índice.
| [in] | info | información a copiarse en el nodo. |
| bad_alloc | si no hay suficiente memoria. |
Definition at line 144 of file tpl_indexGraph.H.
References Aleph::Index_Graph< GT, Compare, Tree >::idx_node, and Aleph::maps().
Referenced by main(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), and TEST_F().
|
inline |
Elimina del grafo y del índice el arco a.
Definition at line 223 of file tpl_indexGraph.H.
References Aleph::Index_Graph< GT, Compare, Tree >::idx_arc.
|
inline |
Elimina el nodo p del grafo y del índice.
| [in] | p | puntero al nodo a eliminar |
Definition at line 212 of file tpl_indexGraph.H.
References Aleph::Index_Graph< GT, Compare, Tree >::idx_arc, and Aleph::Index_Graph< GT, Compare, Tree >::idx_node.
Referenced by TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), and TEST_F().
|
inline |
Busca en el índice un arco dados dos nodos.
| [in] | src | puntero al nodo origen. |
| [in] | tgt | puntero al nodo destino. |
Definition at line 203 of file tpl_indexGraph.H.
References Aleph::Index_Graph< GT, Compare, Tree >::idx_arc.
Referenced by main(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), and TEST_F().
|
inline |
Busca en el índice un nodo.
| [in] | info | información según la cual se buscará el nodo. |
Definition at line 191 of file tpl_indexGraph.H.
References Aleph::Index_Graph< GT, Compare, Tree >::idx_node, and Aleph::maps().
|
inline |
Busca en el índice un nodo.
| [in] | p | puntero al nodo. |
Definition at line 177 of file tpl_indexGraph.H.
References Aleph::Index_Graph< GT, Compare, Tree >::idx_node.
Referenced by main(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), and TEST_F().
Definition at line 128 of file tpl_indexGraph.H.
Referenced by Aleph::Index_Graph< GT, Compare, Tree >::get_num_arcs(), Aleph::Index_Graph< GT, Compare, Tree >::insert_arc(), Aleph::Index_Graph< GT, Compare, Tree >::remove_arc(), Aleph::Index_Graph< GT, Compare, Tree >::remove_node(), and Aleph::Index_Graph< GT, Compare, Tree >::search_arc().
Definition at line 127 of file tpl_indexGraph.H.
Referenced by Aleph::Index_Graph< GT, Compare, Tree >::get_num_nodes(), Aleph::Index_Graph< GT, Compare, Tree >::insert_arc(), Aleph::Index_Graph< GT, Compare, Tree >::insert_node(), Aleph::Index_Graph< GT, Compare, Tree >::remove_node(), Aleph::Index_Graph< GT, Compare, Tree >::search_node(), and Aleph::Index_Graph< GT, Compare, Tree >::search_node().