ModErn Text Analysis
META Enumerates Textual Applications
|
A (currently) simple class to represent a directed graph in memory. More...
#include <directed_graph.h>
Classes | |
class | edge_iterator |
class | node_iterator |
class | undirected_graph |
Public Types | |
using | adjacency_list = typename graph< Node, Edge >::adjacency_list |
using | vec_t = std::vector< std::pair< Node, adjacency_list >> |
typedef node_iterator< typename vec_t::iterator > | iterator |
typedef node_iterator< typename vec_t::const_iterator > | const_iterator |
typedef edge_iterator< typename vec_t::iterator > | e_iterator |
typedef edge_iterator< typename vec_t::const_iterator > | const_e_iterator |
Public Types inherited from meta::graph::graph< Node, Edge > | |
using | adjacency_list = std::vector< std::pair< node_id, Edge >> |
Public Member Functions | |
const adjacency_list & | adjacent (node_id id) const |
const std::vector< node_id > & | incoming (node_id id) const |
virtual node_id | insert (Node node) override |
virtual void | add_edge (Edge edge, node_id source, node_id dest) override |
iterator | begin () |
const_iterator | begin () const |
iterator | end () |
const_iterator | end () const |
e_iterator | edges_begin () |
const_e_iterator | edges_begin () const |
e_iterator | edges_end () |
const_e_iterator | edges_end () const |
Public Member Functions inherited from meta::graph::graph< Node, Edge > | |
virtual Node & | node (node_id id) |
virtual const Node & | node (node_id id) const |
virtual util::optional< Edge > | edge (node_id source, node_id dest) const |
virtual uint64_t | size () const |
virtual uint64_t | num_edges () const |
template<class... Args> | |
node_id | emplace (Args &&...args) |
Constructs a node with forwarded arguments. More... | |
virtual void | add_edge (node_id source, node_id dest) |
Adds a default edge between the two nodes. More... | |
Private Attributes | |
std::vector< std::vector< node_id > > | incoming_ |
Each Node object is indexed by its id. More... | |
Additional Inherited Members | |
Protected Attributes inherited from meta::graph::graph< Node, Edge > | |
std::vector< std::pair< Node, adjacency_list > > | nodes_ |
Each Node object is indexed by its id. | |
uint64_t | num_edges_ = 0 |
Saves the number of edges in this graph. | |
A (currently) simple class to represent a directed graph in memory.
auto directed_graph< Node, Edge >::adjacent | ( | node_id | id | ) | const |
id | The node id to get outgoing nodes from |
const std::vector< node_id > & directed_graph< Node, Edge >::incoming | ( | node_id | id | ) | const |
id | The node id to get incoming nodes to |
|
overridevirtual |
node | The new object to add into the graph |
Implements meta::graph::graph< Node, Edge >.
|
overridevirtual |
edge | |
source | |
dest |
Implements meta::graph::graph< Node, Edge >.
|
inline |
|
inline |
|
inline |
|
inline |
|
private |
Each Node object is indexed by its id.
This structure keeps track of incoming nodes to a specific node_id.