Public Types | Public Member Functions | Protected Attributes | Private Types

mln::util::line_graph< G > Class Template Reference
[Graphes]

Undirected line graph of a graph of type G. More...

#include <line_graph.hh>

Inheritance diagram for mln::util::line_graph< G >:
Inheritance graph

List of all members.

Public Types

typedef Graph< void > category
typedef std::vector< edge_data_tedges_t
 The type of the set of edges.
typedef line_graph< G > exact_t
typedef std::vector
< vertex_data_t
vertices_t
 The type of the set of vertices.

typedef
mln::internal::vertex_fwd_iterator
< line_graph< G > > 
vertex_fwd_iter
 Iterator typesVertex iterators.
typedef
mln::internal::vertex_bkd_iterator
< line_graph< G > > 
vertex_bkd_iter
typedef vertex_fwd_iter vertex_iter

typedef
mln::internal::edge_fwd_iterator
< line_graph< G > > 
edge_fwd_iter
 Edge iterators.
typedef
mln::internal::edge_bkd_iterator
< line_graph< G > > 
edge_bkd_iter
typedef edge_fwd_iter edge_iter

typedef
mln::internal::edge_nbh_edge_fwd_iterator
< line_graph< G > > 
edge_nbh_edge_fwd_iter
 Edge nbh edge iterators.
typedef
mln::internal::edge_nbh_edge_bkd_iterator
< line_graph< G > > 
edge_nbh_edge_bkd_iter
typedef edge_nbh_edge_fwd_iter edge_nbh_edge_iter

typedef
mln::internal::vertex_nbh_vertex_fwd_iterator
< line_graph< G > > 
vertex_nbh_vertex_fwd_iter
 Vertex nbh vertex iterators.
typedef
mln::internal::vertex_nbh_vertex_bkd_iterator
< line_graph< G > > 
vertex_nbh_vertex_bkd_iter
typedef vertex_nbh_vertex_fwd_iter vertex_nbh_vertex_iter

typedef
mln::internal::vertex_nbh_edge_fwd_iterator
< line_graph< G > > 
vertex_nbh_edge_fwd_iter
 Vertex nbh edge iterators.
typedef
mln::internal::vertex_nbh_edge_bkd_iterator
< line_graph< G > > 
vertex_nbh_edge_bkd_iter
typedef vertex_nbh_edge_fwd_iter vertex_nbh_edge_iter

Public Member Functions

const util::tracked_ptr
< mln::internal::data
< line_graph< G > > > & 
data_hook_ () const
 Hook to data; for debugging purpose.
template<typename G2 >
bool has (const util::vertex< G2 > &v) const
 Check whether a vertex v exists in the line graph.
bool has_v (const vertex_id_t &id_v) const
 Check whether a vertex id id_v exists in the line graph.
 line_graph (const G &g)
 line_graph ()
void print_debug (std::ostream &ostr) const
 Print on ostr the graph.
edge_id_t 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 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 v_nmax () const
 Return the number of vertices in the graph.
size_t v_nmax_nbh_edges (const vertex_id_t &id_v) const
 Return the number of adjacent edges of vertex id_v.
size_t v_nmax_nbh_vertices (const vertex_id_t &id_v) const
 Return the number of adjacent vertices of vertex id_v.

vertex_t vertex (const vertex_id_t &id_v) const
 Vertex oriented.

edge_t edge (const edge_id_t &e) const
 Edge oriented.
size_t e_nmax () const
 Return the number of edges in the graph.
bool has_e (const util::edge_id_t &id_e) const
 Return whether id_e is in the line graph.
template<typename G2 >
bool has (const util::edge< G2 > &e) const
 Return whether e is in the line graph.
vertex_id_t v1 (const edge_id_t &id_e) const
 Return the first vertex associated to the edge id_e.
vertex_id_t v2 (const edge_id_t &id_e) const
 Return the second vertex associated to edge id_e.
size_t e_nmax_nbh_edges (const edge_id_t &id_e) const
 Return the number max of adjacent edge, given an edge id_e.
edge_id_t e_ith_nbh_edge (const edge_id_t &id_e, unsigned i) const
 Return the i th edge adjacent to the edge id_e.
template<typename G2 >
bool 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.
const G & graph () const
 Return the underlying graph.

const void * id () const
 Misc.

bool has (const util::vertex< line_graph< G > > &v) const
 Vertex oriented methodsCheck whether a vertex v exists in the graph.

bool has (const util::edge< line_graph< G > > &e) const
 Edge oriented methodsCheck whether an edge e exists in the graph.

vertex_id_t v_other (const edge_id_t &id_e, const vertex_id_t &id_v) const
 Vertex and edge oriented methods.
bool is_valid () const
 Return true if this graph is valid.
void invalidate ()
 Invalidate the graph.

Protected Attributes

util::tracked_ptr
< mln::internal::data
< line_graph< G > > > 
data_
 Internal data, sharable by several graphs.

Private Types

typedef super::edge_data_t edge_data_t
 Internal edge data type.
typedef super::edge_t edge_t
 The type of an edge.
typedef internal::graph_base
< line_graph< G > > 
super
 The super class.
typedef super::vertex_data_t vertex_data_t
 Internal vertex data type.
typedef super::vertex_t vertex_t
 The type of a vertex.

Detailed Description

template<typename G>
class mln::util::line_graph< G >

Undirected line graph of a graph of type G.

Definition at line 82 of file line_graph.hh.


Member Typedef Documentation

typedef Graph<void> mln::Graph< line_graph< G > >::category [inherited]

Reimplemented from mln::Object< line_graph< G > >.

Definition at line 59 of file mln/core/concept/graph.hh.

Definition at line 116 of file line_graph.hh.

template<typename G>
typedef super::edge_data_t mln::util::line_graph< G >::edge_data_t [private]

Internal edge data type.

Reimplemented from mln::util::internal::graph_base< line_graph< G > >.

Definition at line 91 of file line_graph.hh.

Edge iterators.

Definition at line 114 of file line_graph.hh.

template<typename G>
typedef edge_fwd_iter mln::util::line_graph< G >::edge_iter

Definition at line 117 of file line_graph.hh.

Definition at line 125 of file line_graph.hh.

Edge nbh edge iterators.

Definition at line 123 of file line_graph.hh.

Definition at line 126 of file line_graph.hh.

template<typename G>
typedef super::edge_t mln::util::line_graph< G >::edge_t [private]

The type of an edge.

Reimplemented from mln::util::internal::graph_base< line_graph< G > >.

Definition at line 88 of file line_graph.hh.

template<typename G>
typedef std::vector<edge_data_t> mln::util::line_graph< G >::edges_t

The type of the set of edges.

Definition at line 98 of file line_graph.hh.

typedef line_graph< G > mln::Object< line_graph< G > >::exact_t [inherited]

Definition at line 173 of file object.hh.

template<typename G>
typedef internal::graph_base< line_graph<G> > mln::util::line_graph< G >::super [private]

The super class.

Definition at line 85 of file line_graph.hh.

Definition at line 107 of file line_graph.hh.

template<typename G>
typedef super::vertex_data_t mln::util::line_graph< G >::vertex_data_t [private]

Internal vertex data type.

Reimplemented from mln::util::internal::graph_base< line_graph< G > >.

Definition at line 90 of file line_graph.hh.

Iterator typesVertex iterators.

Definition at line 105 of file line_graph.hh.

template<typename G>
typedef vertex_fwd_iter mln::util::line_graph< G >::vertex_iter

Definition at line 108 of file line_graph.hh.

Definition at line 143 of file line_graph.hh.

Vertex nbh edge iterators.

Definition at line 141 of file line_graph.hh.

Definition at line 144 of file line_graph.hh.

Definition at line 134 of file line_graph.hh.

Vertex nbh vertex iterators.

Definition at line 132 of file line_graph.hh.

Definition at line 135 of file line_graph.hh.

template<typename G>
typedef super::vertex_t mln::util::line_graph< G >::vertex_t [private]

The type of a vertex.

Reimplemented from mln::util::internal::graph_base< line_graph< G > >.

Definition at line 87 of file line_graph.hh.

template<typename G>
typedef std::vector<vertex_data_t> mln::util::line_graph< G >::vertices_t

The type of the set of vertices.

Definition at line 95 of file line_graph.hh.


Constructor & Destructor Documentation

template<typename G >
mln::util::line_graph< G >::line_graph (  )  [inline]
template<typename G>
mln::util::line_graph< G >::line_graph ( const G &  g  )  [inline]

Member Function Documentation

const util::tracked_ptr< mln::internal::data<line_graph< G > > >& mln::util::internal::graph_base< line_graph< G > >::data_hook_ (  )  const [inherited]

Hook to data; for debugging purpose.

template<typename G >
edge_id_t mln::util::line_graph< G >::e_ith_nbh_edge ( const edge_id_t id_e,
unsigned  i 
) const [inline]
template<typename G >
size_t mln::util::line_graph< G >::e_nmax (  )  const [inline]

Return the number of edges in the graph.

Definition at line 408 of file line_graph.hh.

References mln::util::internal::graph_base< line_graph< G > >::data_.

Referenced by mln::util::line_graph< G >::e_ith_nbh_edge(), and mln::util::line_graph< G >::edge().

template<typename G >
size_t mln::util::line_graph< G >::e_nmax_nbh_edges ( const edge_id_t id_e  )  const [inline]
template<typename G >
line_graph< G >::edge_t mln::util::line_graph< G >::edge ( const edge_id_t e  )  const [inline]

Edge oriented.

Return the edge whose id is e.

Definition at line 399 of file line_graph.hh.

References mln::util::line_graph< G >::e_nmax().

template<typename G >
const G & mln::util::line_graph< G >::graph (  )  const [inline]

Return the underlying graph.

Definition at line 485 of file line_graph.hh.

References mln::util::internal::graph_base< line_graph< G > >::data_.

template<typename G >
template<typename G2 >
bool mln::util::line_graph< G >::has ( const util::vertex< G2 > &  v  )  const [inline]

Check whether a vertex v exists in the line graph.

Definition at line 345 of file line_graph.hh.

References mln::util::vertex< G >::graph(), mln::util::line_graph< G >::has_v(), and mln::util::vertex< G >::id().

bool mln::util::internal::graph_base< line_graph< G > >::has ( const util::vertex< line_graph< G > > &  v  )  const [inherited]

Vertex oriented methodsCheck whether a vertex v exists in the graph.

bool mln::util::internal::graph_base< line_graph< G > >::has ( const util::edge< line_graph< G > > &  e  )  const [inherited]

Edge oriented methodsCheck whether an edge e exists in the graph.

template<typename G >
template<typename G2 >
bool mln::util::line_graph< G >::has ( const util::edge< G2 > &  e  )  const [inline]

Return whether e is in the line graph.

Definition at line 425 of file line_graph.hh.

References mln::util::edge< G >::graph(), mln::util::line_graph< G >::has_e(), and mln::util::edge< G >::id().

template<typename G >
bool mln::util::line_graph< G >::has_e ( const util::edge_id_t id_e  )  const [inline]
template<typename G >
bool mln::util::line_graph< G >::has_v ( const vertex_id_t id_v  )  const [inline]
const void* mln::util::internal::graph_base< line_graph< G > >::id (  )  const [inherited]

Misc.

methods

Returns the graph id, the "this" pointer.

Referenced by mln::util::line_graph< G >::is_subgraph_of().

void mln::util::internal::graph_base< line_graph< G > >::invalidate (  )  [inherited]

Invalidate the graph.

template<typename G >
template<typename G2 >
bool mln::util::line_graph< G >::is_subgraph_of ( const G2 &  g  )  const [inline]

Return whether this graph is a subgraph Return true if g and *this have the same graph_id.

Definition at line 477 of file line_graph.hh.

References mln::util::internal::graph_base< line_graph< G > >::id().

bool mln::util::internal::graph_base< line_graph< G > >::is_valid (  )  const [inherited]

Return true if this graph is valid.

void mln::util::internal::graph_base< line_graph< G > >::print_debug ( std::ostream &  ostr  )  const [inherited]

Print on ostr the graph.

Parameters:
[in] ostr The output stream.
template<typename G >
vertex_id_t mln::util::line_graph< G >::v1 ( const edge_id_t id_e  )  const [inline]
template<typename G >
vertex_id_t mln::util::line_graph< G >::v2 ( const edge_id_t id_e  )  const [inline]
template<typename G >
edge_id_t mln::util::line_graph< G >::v_ith_nbh_edge ( const vertex_id_t id_v,
unsigned  i 
) const [inline]
template<typename G >
vertex_id_t mln::util::line_graph< G >::v_ith_nbh_vertex ( const vertex_id_t id_v,
unsigned  i 
) const [inline]

Returns the i th vertex adjacent to the vertex id_v.

Definition at line 383 of file line_graph.hh.

References mln::util::line_graph< G >::has_v(), mln::util::line_graph< G >::v_ith_nbh_edge(), and mln::util::internal::graph_base< line_graph< G > >::v_other().

template<typename G >
size_t mln::util::line_graph< G >::v_nmax (  )  const [inline]

Return the number of vertices in the graph.

Definition at line 328 of file line_graph.hh.

References mln::util::internal::graph_base< line_graph< G > >::data_.

Referenced by mln::util::line_graph< G >::v_ith_nbh_edge().

template<typename G >
size_t mln::util::line_graph< G >::v_nmax_nbh_edges ( const vertex_id_t id_v  )  const [inline]
template<typename G >
size_t mln::util::line_graph< G >::v_nmax_nbh_vertices ( const vertex_id_t id_v  )  const [inline]

Return the number of adjacent vertices of vertex id_v.

Definition at line 374 of file line_graph.hh.

References mln::util::line_graph< G >::has_v(), and mln::util::line_graph< G >::v_nmax_nbh_edges().

vertex_id_t mln::util::internal::graph_base< line_graph< G > >::v_other ( const edge_id_t id_e,
const vertex_id_t id_v 
) const [inherited]

Vertex and edge oriented methods.

Returns the other adjacent vertex id of a given edge id id_e.

Referenced by mln::util::line_graph< G >::v_ith_nbh_vertex().

template<typename G >
line_graph< G >::vertex_t mln::util::line_graph< G >::vertex ( const vertex_id_t id_v  )  const [inline]

Vertex oriented.

Shortcuts factoring the insertion of vertices and edges.

Return the vertex whose id is v.

Definition at line 318 of file line_graph.hh.

References mln::util::line_graph< G >::has_v().


Member Data Documentation

util::tracked_ptr< mln::internal::data<line_graph< G > > > mln::util::internal::graph_base< line_graph< G > >::data_ [protected, inherited]