$extrastylesheet
#include <mln/util/graph.hh>
Public Member Functions | |
graph () | |
graph (unsigned nvertices) | |
const util::tracked_ptr < mln::internal::data< graph > > & | data_hook_ () const |
bool | has_v (const vertex_id_t &id_v) const |
void | print_debug (std::ostream &ostr) const |
edge_id_t | v_ith_nbh_edge (const vertex_id_t &id_v, unsigned i) const |
vertex_id_t | v_ith_nbh_vertex (const vertex_id_t &id_v, unsigned i) const |
size_t | v_nmax () const |
size_t | v_nmax_nbh_edges (const vertex_id_t &id_v) const |
size_t | v_nmax_nbh_vertices (const vertex_id_t &id_v) const |
unsigned | add_vertex () |
std::pair< vertex_id_t, vertex_id_t > | add_vertices (unsigned n) |
vertex_t | vertex (vertex_id_t id_v) const |
edge_id_t | add_edge (const vertex_id_t &id_v1, const vertex_id_t &id_v2) |
edge_t | edge (const edge_id_t &e) const |
const std::vector < util::ord_pair< vertex_id_t > > & | edges () const |
size_t | e_nmax () const |
bool | has_e (const edge_id_t &id_e) const |
edge_t | edge (const vertex_t &v1, const vertex_t &v2) const |
vertex_id_t | v1 (const edge_id_t &id_e) const |
vertex_id_t | v2 (const edge_id_t &id_e) const |
size_t | e_nmax_nbh_edges (const edge_id_t &id_e) const |
edge_id_t | e_ith_nbh_edge (const edge_id_t &id_e, unsigned i) const |
template<typename G2 > | |
bool | is_subgraph_of (const G2 &g) const |
const void * | id () const |
bool | has (const util::vertex< graph > &v) const |
bool | has (const util::edge< graph > &e) const |
vertex_id_t | v_other (const edge_id_t &id_e, const vertex_id_t &id_v) const |
bool | is_valid () const |
void | invalidate () |
Protected Attributes | |
util::tracked_ptr < mln::internal::data< graph > > | data_ |
Undirected graph.
Definition at line 90 of file util/graph.hh.
mln::util::graph::graph | ( | ) |
Constructor.
mln::util::graph::graph | ( | unsigned | nvertices | ) |
Construct a graph with nvertices
vertices.
edge_id_t mln::util::graph::add_edge | ( | const vertex_id_t & | id_v1, |
const vertex_id_t & | id_v2 | ||
) |
Edge oriented.
Add an edge.
mln_max(unsigned)
. unsigned mln::util::graph::add_vertex | ( | ) |
Vertex oriented.
Shortcuts factoring the insertion of vertices and edges.Add a vertex.
std::pair<vertex_id_t, vertex_id_t> mln::util::graph::add_vertices | ( | unsigned | n | ) |
Add n
vertices to the graph.
|
inherited |
Hook to data; for debugging purpose.
Return the i
th edge adjacent to the edge id_e
.
size_t mln::util::graph::e_nmax | ( | ) | const |
Return the number of edges in the graph.
size_t mln::util::graph::e_nmax_nbh_edges | ( | const edge_id_t & | id_e | ) | const |
Return the number max of adjacent edge, given an edge id_e
.
Return the corresponding edge id if exists.
If it is not, returns an invalid edge.
const std::vector<util::ord_pair<vertex_id_t> >& mln::util::graph::edges | ( | ) | const |
Return the list of all edges.
|
inherited |
Vertex oriented methodsCheck whether a vertex v
exists in the graph.
|
inherited |
Edge oriented methodsCheck whether an edge e
exists in the graph.
bool mln::util::graph::has_v | ( | const vertex_id_t & | id_v | ) | const |
Check whether a vertex id id_v
exists in the graph.
|
inherited |
Misc.
methods
Returns the graph id, the "this" pointer.
|
inherited |
Invalidate the graph.
bool mln::util::graph::is_subgraph_of | ( | const G2 & | g | ) | const |
Return whether this graph is a subgraph Return true if g and *this have the same graph_id.
|
inherited |
Return true if this graph is valid.
|
inherited |
Print on ostr
the graph.
[in] | ostr | The output stream. |
vertex_id_t mln::util::graph::v1 | ( | const edge_id_t & | id_e | ) | const |
Return the first vertex associated to the edge id_e
.
vertex_id_t mln::util::graph::v2 | ( | const edge_id_t & | id_e | ) | const |
Return the second vertex associated to edge id_e
.
edge_id_t mln::util::graph::v_ith_nbh_edge | ( | const vertex_id_t & | id_v, |
unsigned | i | ||
) | const |
Returns the i
th edge adjacent to the vertex id_v
.
vertex_id_t mln::util::graph::v_ith_nbh_vertex | ( | const vertex_id_t & | id_v, |
unsigned | i | ||
) | const |
Returns the i
th vertex adjacent to the vertex id_v
.
size_t mln::util::graph::v_nmax | ( | ) | const |
Return the number of vertices in the graph.
size_t mln::util::graph::v_nmax_nbh_edges | ( | const vertex_id_t & | id_v | ) | const |
Return the number of adjacent edges of vertex id_v
.
size_t mln::util::graph::v_nmax_nbh_vertices | ( | const vertex_id_t & | id_v | ) | const |
Return the number of adjacent vertices of vertex id_v
.
|
inherited |
Vertex and edge oriented methods.
Returns the other adjacent vertex id of a given edge id id_e
.
vertex_t mln::util::graph::vertex | ( | vertex_id_t | id_v | ) | const |
Return the vertex whose id is v.
|
protectedinherited |
Internal data, sharable by several graphs.
Definition at line 129 of file graph_base.hh.
|
inherited |
Definition at line 62 of file core/concept/graph.hh.
Definition at line 133 of file util/graph.hh.
Edge iterators.
Definition at line 132 of file util/graph.hh.
Definition at line 134 of file util/graph.hh.
Definition at line 140 of file util/graph.hh.
Edge centered edge iterators.
Definition at line 139 of file util/graph.hh.
Definition at line 141 of file util/graph.hh.
|
inherited |
The type of an edge.
Definition at line 75 of file graph_base.hh.
typedef std::set<edge_data_t> mln::util::graph::edges_set_t |
A set to test the presence of a given edge.
Definition at line 105 of file util/graph.hh.
typedef std::vector<edge_data_t> mln::util::graph::edges_t |
The type of the set of edges.
Definition at line 103 of file util/graph.hh.
Definition at line 112 of file util/graph.hh.
Iterator typesVertex iterators.
Definition at line 111 of file util/graph.hh.
Definition at line 113 of file util/graph.hh.
typedef mln::internal::vertex_nbh_edge_bkd_iterator<graph> mln::util::graph::vertex_nbh_edge_bkd_iter |
Definition at line 119 of file util/graph.hh.
typedef mln::internal::vertex_nbh_edge_fwd_iterator<graph> mln::util::graph::vertex_nbh_edge_fwd_iter |
Vertex centered edge iterators.
Definition at line 118 of file util/graph.hh.
Definition at line 120 of file util/graph.hh.
typedef mln::internal::vertex_nbh_vertex_bkd_iterator<graph> mln::util::graph::vertex_nbh_vertex_bkd_iter |
Definition at line 126 of file util/graph.hh.
typedef mln::internal::vertex_nbh_vertex_fwd_iterator<graph> mln::util::graph::vertex_nbh_vertex_fwd_iter |
Vertex centered vertex iterators.
Definition at line 125 of file util/graph.hh.
Definition at line 127 of file util/graph.hh.
|
inherited |
The type of a vertex.
Definition at line 73 of file graph_base.hh.
typedef std::vector<vertex_data_t> mln::util::graph::vertices_t |
The type of the set of vertices.
Definition at line 100 of file util/graph.hh.