MorphoGraphX  2.0-1-227
Classes | Public Member Functions | List of all members
mgx::VVGraph< VertexContent, EdgeContent > Class Template Reference

#include <VVGraph.hpp>

Classes

struct  neighbor_t
 Structure maintaining the data for a single neighbor. More...
 
struct  NeighborhoodPair
 
struct  search_result_t
 Type of the result of the search for a vertex in a neighborhood. More...
 
struct  single_neighborhood_t
 Type of the neighborhood of a vertex. More...
 

Public Types

Iterators
typedef SelectMemberPointerIterator< typename neighborhood_t::iterator, const vertex_t, &NeighborhoodPair::vertexiterator
 Iterator on the vertexes. More...
 
typedef SelectMemberPointerIterator< typename neighborhood_t::const_iterator, const vertex_t, &NeighborhoodPair::vertexconst_iterator
 Constant iterator on the vertexes. More...
 
typedef SelectMemberIterator< typename edge_list_t::iterator, vertex_t, &neighbor_t::targetneighbor_iterator
 Iterator on the neighbors of a vertex. More...
 
typedef std::pair< neighbor_iterator, neighbor_iteratorneighbor_iterator_pair
 Range of the neighbors of a vertex. More...
 
typedef CircIterator< neighbor_iteratorcirc_neighbor_iterator
 Iterator used to iterate over the neighbors, but specifying the starting point. More...
 
typedef std::pair< circ_neighbor_iterator, circ_neighbor_iteratorcirc_neighbor_iterator_pair
 Range of circular iterators. More...
 
typedef SelectMemberIterator< typename edge_list_t::const_iterator, const vertex_t, &neighbor_t::targetconst_neighbor_iterator
 Constant iterator on the neighbors of a vertex. More...
 
typedef std::pair< const_neighbor_iterator, const_neighbor_iteratorconst_neighbor_iterator_pair
 Constant range of the neighbors of a vertex. More...
 
typedef CircIterator< const_neighbor_iteratorconst_circ_neighbor_iterator
 Iterator used to iterate over the neighbors, but spcifying the starting point. More...
 
typedef std::pair< const_circ_neighbor_iterator, const_circ_neighbor_iteratorconst_circ_neighbor_iterator_pair
 Range of circular iterators. More...
 

Public Member Functions

template<typename VertexContainer >
VVGraph< VertexContent, EdgeContent > subgraph (const VertexContainer &verts) const
 
Vertex set editing methods
size_type erase (const vertex_t &v)
 Remove a vertex from the graph. More...
 
bool insert (const vertex_t &v, bool checkUnique=true)
 Insert a new vertex in the graph. More...
 
Vertex set lookup methods
const vertex_tany () const
 Return a vertex from the graph. More...
 
const vertex_toperator[] (size_type idx) const
 Return the element of index idx. More...
 
bool contains (const vertex_t &v) const
 Test if v is in the graph. More...
 
const vertex_treference (vertex_t v) const
 Get a reference on the vertex in the graph. More...
 
size_type size () const
 Return the number of vertexes on the graph. More...
 
bool empty () const
 Test if there is any vertex in the graph. More...
 
bool isModified () const
 Test if vertex list has been modified. More...
 
void setModified (bool _modified)
 Set modified status. More...
 
Neighborhood lookup methods
const vertex_tanyIn (const vertex_t &v) const
 Return a vertex in the neighborhood of v. More...
 
size_type valence (const vertex_t &v) const
 Returns the number of neighbors of v. More...
 
bool empty (const vertex_t &v) const
 Test if a vertex has a neighbor. More...
 
const vertex_tnextTo (const vertex_t &v, const vertex_t &neighbor, unsigned int n=1) const
 Returns the nth vertex after neighbor in the neighborhood of v. More...
 
const vertex_tprevTo (const vertex_t &v, const vertex_t &ref, unsigned int n=1) const
 Returns the nth vertex before ref in the neighborhood of v. More...
 
edge_t edge (const vertex_t &src, const vertex_t &tgt)
 Returns the edge from src to tgt. More...
 
const_edge_t edge (const vertex_t &src, const vertex_t &tgt) const
 Returns the edge from src to tgt. More...
 
const_neighbor_iterator_pair neighbors (const vertex_t &v) const
 Return the constant range of neighbors of v. More...
 
neighbor_iterator_pair neighbors (const vertex_t &v)
 Return the range of neighbors of v. More...
 
circ_neighbor_iterator_pair neighbors (const vertex_t &v, const vertex_t &n)
 Return the range of neighbors of v, starting at n. More...
 
const_circ_neighbor_iterator_pair neighbors (const vertex_t &v, const vertex_t &n) const
 Return the range of neighbors of v, starting at n. More...
 
const vertex_tsource (const edge_t &edge) const
 Return the source vertex of the edge. More...
 
const vertex_ttarget (const edge_t &edge) const
 Return the target vertex of the edge. More...
 
Neighborhood editing methods
size_type eraseEdge (const vertex_t &src, const vertex_t &tgt)
 Erase the edge from src to tgt. More...
 
edge_t replace (const vertex_t &v, const vertex_t &neighbor, const vertex_t &new_neighbor)
 Replace a vertex by another in a neighborhood. More...
 
edge_t spliceAfter (const vertex_t &v, const vertex_t &neighbor, const vertex_t &new_neighbor)
 Insert neighbor in the neighborhood of v after reference. More...
 
edge_t spliceBefore (const vertex_t &v, const vertex_t &neighbor, const vertex_t &new_neighbor)
 Insert neighbor in the neighborhood of v before reference. More...
 
edge_t insertEdge (const vertex_t &src, const vertex_t &tgt)
 Insert a new edge in the graph, without ordering. More...
 
bool eraseAllEdges (const vertex_t &v)
 Clear the neighborhood of a vertex. More...
 
bool clear (const vertex_t &v)
 Clear the outgoing edges of a vertex. More...
 
bool uniqueTri (const vertex_t &v, const vertex_t &n, const vertex_t &m) const
 Test for unique triangle. More...
 
bool uniqueLine (const vertex_t &v, const vertex_t &n) const
 Test for unique line. More...
 
Whole structure methods
VVGraphoperator= (const VVGraph &other)
 Copy the graph into another graph. More...
 
VVGraphreverse ()
 Reverse the order of all the neighbors. More...
 
void swap (VVGraph &other)
 Swap the content of both graphs. More...
 
bool operator== (const VVGraph &other) const
 Test equality for the graphs. More...
 
void clear ()
 Clear the graph. More...
 
void eraseAllEdges ()
 Clear all the edges in the graph. More...
 
template<typename VertexContainer >
VVGraph subgraph (const VertexContainer &vertexes) const
 Extract the subgraph containing the vertexes. More...
 

Smart pointer types

typedef Vertex< VertexContent > vertex_t
 Smart pointer on a vertex. More...
 
typedef Edge< EdgeContent > edge_t
 Weak pointer on an edge. More...
 
typedef Edge< const EdgeContent > const_edge_t
 Weak pointer on a constant edge. More...
 
typedef vertex_t value_type
 Type of the value of the graph as standard container. More...
 
typedef std::vector< NeighborhoodPair * > neighborhood_t
 Type of the list of vertexes, together with the neighborhood. More...
 
typedef std::unordered_map< vertex_t, NeighborhoodPair * > lookup_t
 Type of the fast-search map. More...
 
typedef neighborhood_t::value_type neighborhood_value_type
 Shortcut for the value_type of the neighborhood. More...
 
typedef neighborhood_t::size_type size_type
 Type of a size. More...
 
typedef neighbor_t::edge_list_t edge_list_t
 Type of the list of outgoing neighbors. More...
 
 VVGraph ()
 Default constructor. More...
 
 VVGraph (const VVGraph &copy)
 Copy constructor. More...
 
 ~VVGraph ()
 Destructor. More...
 
template<typename Iterator >
 VVGraph (Iterator begin, Iterator end, bool checkUnique=true)
 Construct from an existing list of vertices. More...
 
template<typename Container >
 VVGraph (const Container &c, bool checkUnique=true)
 Construct from an existing list of vertices. More...
 

STL compatibility methods

typedef edge_list_t::iterator int_neighbor_iterator
 Iterator on the outgoing edges. More...
 
typedef edge_list_t::const_iterator int_const_neighbor_iterator
 Constant iterator on the outgoing edges. More...
 
typedef search_result_t< single_neighborhood_t, int_neighbor_iteratorneighbor_found_t
 Result of a search in the neighborhood. More...
 
typedef search_result_t< const single_neighborhood_t, int_const_neighbor_iteratorconst_neighbor_found_t
 Constant result of a search in the neighborhood. More...
 
neighborhood_t neighborhood
 Main data structure containing everything. More...
 
lookup_t lookup
 Hash map to optimise look-up. More...
 
bool modified
 If true, the vertex list has been modified. More...
 
void erase (iterator pos)
 Erase element at position pos. More...
 
size_type eraseEdge (const vertex_t &v, neighbor_iterator pos)
 Erase the edge pointed to by the iterator. More...
 
size_type eraseEdge (const vertex_t &v, circ_neighbor_iterator pos)
 Erase the edge pointed to by the iterator. More...
 
template<typename Iterator >
void insert (Iterator first, Iterator last, bool checkUnique=true)
 Insert all the vertexes from first to last-1 in the graph. More...
 
template<typename Iterator >
void insert (const std::pair< Iterator, Iterator > &range, bool checkUnique=true)
 Insert all the vertexes from range.first to range.last-1 in the graph. More...
 
iterator begin ()
 Returns an iterator on the beginning of the set of vertexes of the graph. More...
 
iterator end ()
 Returns an iterator on the end of the set of vertexes of the graph. More...
 
const_iterator begin () const
 Returns an iterator on the beginning of the set of vertexes of the graph. More...
 
const_iterator end () const
 Returns an iterator on the end of the set of vertexes of the graph. More...
 
size_type count (const vertex_t &v) const
 Count the number of vertexes v in the graph (can be 0 or 1 only) More...
 
neighbor_iterator findIn (const vertex_t &v, const vertex_t &n)
 Find the vertex n in the neighborhood of v. More...
 
const_neighbor_iterator findIn (const vertex_t &v, const vertex_t &n) const
 Find the vertex n in the neighborhood of v. More...
 
void eraseAllEdges (iterator it)
 Clear the neighborhood of a vertex. More...
 
void clear (iterator it)
 Clear the outgoing edges of a vertex. More...
 
void reserve (size_type s)
 Reserve space for more vertices. More...
 
void eraseAllEdges (NeighborhoodPair *it)
 
NeighborhoodPairfindVertex (const vertex_t &v)
 Find a vertex in the graph and returns the iterator on it. More...
 
const NeighborhoodPairfindVertex (const vertex_t &v) const
 Constant version of findVertex(const vertex_t&) More...
 
neighborhood_t::iterator findIterator (const NeighborhoodPair *np)
 Find the iterator for a given neighborhood pair. More...
 
neighborhood_t::const_iterator findIterator (const NeighborhoodPair *np) const
 
neighbor_found_t findInVertex (const vertex_t &v, const vertex_t &neighbor)
 Find a vertex neighbor in the neighborhood of v. More...
 
const_neighbor_found_t findInVertex (const vertex_t &v, const vertex_t &neighbor) const
 Constant version of findInVertex(const vertex_t&, const vertex_t&) More...
 

Detailed Description

template<typename VertexContent, typename EdgeContent = _EmptyEdgeContent>
class mgx::VVGraph< VertexContent, EdgeContent >

Class representing a VV graph.

A VV graph is a graph rotation system, that is, a graph where the neighbors of vertices are stored in a circular order.

VertexContent is the type used to hold the vertex data.

EdgeContent is the type used to hold the edge data. If no type is specified for EdgeContent, then an empty structure is used.

Definition at line 162 of file VVGraph.hpp.

Member Typedef Documentation

◆ circ_neighbor_iterator

template<typename VertexContent , typename EdgeContent = _EmptyEdgeContent>
typedef CircIterator<neighbor_iterator> mgx::VVGraph< VertexContent, EdgeContent >::circ_neighbor_iterator

Iterator used to iterate over the neighbors, but specifying the starting point.

Definition at line 390 of file VVGraph.hpp.

◆ circ_neighbor_iterator_pair

template<typename VertexContent , typename EdgeContent = _EmptyEdgeContent>
typedef std::pair<circ_neighbor_iterator, circ_neighbor_iterator> mgx::VVGraph< VertexContent, EdgeContent >::circ_neighbor_iterator_pair

Range of circular iterators.

Definition at line 395 of file VVGraph.hpp.

◆ const_circ_neighbor_iterator

template<typename VertexContent , typename EdgeContent = _EmptyEdgeContent>
typedef CircIterator<const_neighbor_iterator> mgx::VVGraph< VertexContent, EdgeContent >::const_circ_neighbor_iterator

Iterator used to iterate over the neighbors, but spcifying the starting point.

Definition at line 415 of file VVGraph.hpp.

◆ const_circ_neighbor_iterator_pair

template<typename VertexContent , typename EdgeContent = _EmptyEdgeContent>
typedef std::pair<const_circ_neighbor_iterator, const_circ_neighbor_iterator> mgx::VVGraph< VertexContent, EdgeContent >::const_circ_neighbor_iterator_pair

Range of circular iterators.

Definition at line 421 of file VVGraph.hpp.

◆ const_edge_t

template<typename VertexContent , typename EdgeContent = _EmptyEdgeContent>
typedef Edge<const EdgeContent> mgx::VVGraph< VertexContent, EdgeContent >::const_edge_t

Weak pointer on a constant edge.

Definition at line 178 of file VVGraph.hpp.

◆ const_iterator

template<typename VertexContent , typename EdgeContent = _EmptyEdgeContent>
typedef SelectMemberPointerIterator<typename neighborhood_t::const_iterator, const vertex_t, &NeighborhoodPair::vertex> mgx::VVGraph< VertexContent, EdgeContent >::const_iterator

Constant iterator on the vertexes.

Definition at line 373 of file VVGraph.hpp.

◆ const_neighbor_found_t

template<typename VertexContent , typename EdgeContent = _EmptyEdgeContent>
typedef search_result_t<const single_neighborhood_t, int_const_neighbor_iterator> mgx::VVGraph< VertexContent, EdgeContent >::const_neighbor_found_t
protected

Constant result of a search in the neighborhood.

Definition at line 1293 of file VVGraph.hpp.

◆ const_neighbor_iterator

template<typename VertexContent , typename EdgeContent = _EmptyEdgeContent>
typedef SelectMemberIterator<typename edge_list_t::const_iterator, const vertex_t, &neighbor_t::target> mgx::VVGraph< VertexContent, EdgeContent >::const_neighbor_iterator

Constant iterator on the neighbors of a vertex.

Definition at line 402 of file VVGraph.hpp.

◆ const_neighbor_iterator_pair

template<typename VertexContent , typename EdgeContent = _EmptyEdgeContent>
typedef std::pair<const_neighbor_iterator, const_neighbor_iterator> mgx::VVGraph< VertexContent, EdgeContent >::const_neighbor_iterator_pair

Constant range of the neighbors of a vertex.

The first element of the pair is a constant iterator on the beginning of the range, the second element is the past-the-end constant iterator.

Definition at line 409 of file VVGraph.hpp.

◆ edge_list_t

template<typename VertexContent , typename EdgeContent = _EmptyEdgeContent>
typedef neighbor_t::edge_list_t mgx::VVGraph< VertexContent, EdgeContent >::edge_list_t
protected

Type of the list of outgoing neighbors.

Definition at line 291 of file VVGraph.hpp.

◆ edge_t

template<typename VertexContent , typename EdgeContent = _EmptyEdgeContent>
typedef Edge<EdgeContent> mgx::VVGraph< VertexContent, EdgeContent >::edge_t

Weak pointer on an edge.

Definition at line 174 of file VVGraph.hpp.

◆ int_const_neighbor_iterator

template<typename VertexContent , typename EdgeContent = _EmptyEdgeContent>
typedef edge_list_t::const_iterator mgx::VVGraph< VertexContent, EdgeContent >::int_const_neighbor_iterator
protected

Constant iterator on the outgoing edges.

Definition at line 1283 of file VVGraph.hpp.

◆ int_neighbor_iterator

template<typename VertexContent , typename EdgeContent = _EmptyEdgeContent>
typedef edge_list_t::iterator mgx::VVGraph< VertexContent, EdgeContent >::int_neighbor_iterator
protected

Iterator on the outgoing edges.

Definition at line 1279 of file VVGraph.hpp.

◆ iterator

template<typename VertexContent , typename EdgeContent = _EmptyEdgeContent>
typedef SelectMemberPointerIterator<typename neighborhood_t::iterator, const vertex_t, &NeighborhoodPair::vertex> mgx::VVGraph< VertexContent, EdgeContent >::iterator

Iterator on the vertexes.

Definition at line 368 of file VVGraph.hpp.

◆ lookup_t

template<typename VertexContent , typename EdgeContent = _EmptyEdgeContent>
typedef std::unordered_map<vertex_t, NeighborhoodPair*> mgx::VVGraph< VertexContent, EdgeContent >::lookup_t

Type of the fast-search map.

Definition at line 350 of file VVGraph.hpp.

◆ neighbor_found_t

template<typename VertexContent , typename EdgeContent = _EmptyEdgeContent>
typedef search_result_t<single_neighborhood_t, int_neighbor_iterator> mgx::VVGraph< VertexContent, EdgeContent >::neighbor_found_t
protected

Result of a search in the neighborhood.

Definition at line 1288 of file VVGraph.hpp.

◆ neighbor_iterator

template<typename VertexContent , typename EdgeContent = _EmptyEdgeContent>
typedef SelectMemberIterator<typename edge_list_t::iterator, vertex_t, &neighbor_t::target> mgx::VVGraph< VertexContent, EdgeContent >::neighbor_iterator

Iterator on the neighbors of a vertex.

Definition at line 378 of file VVGraph.hpp.

◆ neighbor_iterator_pair

template<typename VertexContent , typename EdgeContent = _EmptyEdgeContent>
typedef std::pair<neighbor_iterator, neighbor_iterator> mgx::VVGraph< VertexContent, EdgeContent >::neighbor_iterator_pair

Range of the neighbors of a vertex.

The first element of the pair is an iterator on the beginning of the range, the second element is the past-the-end iterator.

Definition at line 384 of file VVGraph.hpp.

◆ neighborhood_t

template<typename VertexContent , typename EdgeContent = _EmptyEdgeContent>
typedef std::vector<NeighborhoodPair*> mgx::VVGraph< VertexContent, EdgeContent >::neighborhood_t

Type of the list of vertexes, together with the neighborhood.

Definition at line 345 of file VVGraph.hpp.

◆ neighborhood_value_type

template<typename VertexContent , typename EdgeContent = _EmptyEdgeContent>
typedef neighborhood_t::value_type mgx::VVGraph< VertexContent, EdgeContent >::neighborhood_value_type

Shortcut for the value_type of the neighborhood.

Definition at line 355 of file VVGraph.hpp.

◆ size_type

template<typename VertexContent , typename EdgeContent = _EmptyEdgeContent>
typedef neighborhood_t::size_type mgx::VVGraph< VertexContent, EdgeContent >::size_type

Type of a size.

Definition at line 360 of file VVGraph.hpp.

◆ value_type

template<typename VertexContent , typename EdgeContent = _EmptyEdgeContent>
typedef vertex_t mgx::VVGraph< VertexContent, EdgeContent >::value_type

Type of the value of the graph as standard container.

Definition at line 184 of file VVGraph.hpp.

◆ vertex_t

template<typename VertexContent , typename EdgeContent = _EmptyEdgeContent>
typedef Vertex<VertexContent> mgx::VVGraph< VertexContent, EdgeContent >::vertex_t

Smart pointer on a vertex.

Definition at line 170 of file VVGraph.hpp.

Constructor & Destructor Documentation

◆ VVGraph() [1/4]

template<typename VertexContent , typename EdgeContent = _EmptyEdgeContent>
mgx::VVGraph< VertexContent, EdgeContent >::VVGraph ( )
inline

Default constructor.

Creates an empty VV graph

Definition at line 191 of file VVGraph.hpp.

◆ VVGraph() [2/4]

template<typename VertexContent , typename EdgeContent >
mgx::VVGraph< VertexContent, EdgeContent >::VVGraph ( const VVGraph< VertexContent, EdgeContent > &  copy)

Copy constructor.

Definition at line 1948 of file VVGraph.hpp.

◆ ~VVGraph()

template<typename VertexContent , typename EdgeContent = _EmptyEdgeContent>
mgx::VVGraph< VertexContent, EdgeContent >::~VVGraph ( )
inline

Destructor.

Definition at line 201 of file VVGraph.hpp.

◆ VVGraph() [3/4]

template<typename VertexContent , typename EdgeContent = _EmptyEdgeContent>
template<typename Iterator >
mgx::VVGraph< VertexContent, EdgeContent >::VVGraph ( Iterator  begin,
Iterator  end,
bool  checkUnique = true 
)
inline

Construct from an existing list of vertices.

Parameters
checkUniqueIf false, there must be not be duplicated vertex in the sequence

Definition at line 217 of file VVGraph.hpp.

◆ VVGraph() [4/4]

template<typename VertexContent , typename EdgeContent = _EmptyEdgeContent>
template<typename Container >
mgx::VVGraph< VertexContent, EdgeContent >::VVGraph ( const Container &  c,
bool  checkUnique = true 
)
inline

Construct from an existing list of vertices.

Parameters
checkUniqueIf false, there must be not be duplicated vertex in the sequence

Definition at line 227 of file VVGraph.hpp.

Member Function Documentation

◆ any()

template<typename VertexContent , typename EdgeContent >
const VVGraph< VertexContent, EdgeContent >::vertex_t & mgx::VVGraph< VertexContent, EdgeContent >::any

Return a vertex from the graph.

Returns
A vertex of the graph, or a null vertex if the graph is empty.

Example:

// Add vertices in S
const vertex& v = S.any(); // Get a vertex in S

Definition at line 1516 of file VVGraph.hpp.

◆ anyIn()

template<typename VertexContent , typename EdgeContent >
const VVGraph< VertexContent, EdgeContent >::vertex_t & mgx::VVGraph< VertexContent, EdgeContent >::anyIn ( const vertex_t v) const

Return a vertex in the neighborhood of v.

Returns
A vertex in the neighborhood of v, or a null vertex if v is not in the graph or v has no neighborhood.

Example:

forall(const vertex& v, S)
{
const vertex& n = S.anyIn(v);
if(n)
{
edge e = S.edge(v,n); // e exist !
}
}

Definition at line 1536 of file VVGraph.hpp.

◆ begin() [1/2]

template<typename VertexContent , typename EdgeContent = _EmptyEdgeContent>
iterator mgx::VVGraph< VertexContent, EdgeContent >::begin ( )
inline

Returns an iterator on the beginning of the set of vertexes of the graph.

Definition at line 1155 of file VVGraph.hpp.

◆ begin() [2/2]

template<typename VertexContent , typename EdgeContent = _EmptyEdgeContent>
const_iterator mgx::VVGraph< VertexContent, EdgeContent >::begin ( ) const
inline

Returns an iterator on the beginning of the set of vertexes of the graph.

Definition at line 1168 of file VVGraph.hpp.

◆ clear() [1/3]

template<typename VertexContent , typename EdgeContent >
void mgx::VVGraph< VertexContent, EdgeContent >::clear

Clear the graph.

Definition at line 1350 of file VVGraph.hpp.

◆ clear() [2/3]

template<typename VertexContent , typename EdgeContent >
bool mgx::VVGraph< VertexContent, EdgeContent >::clear ( const vertex_t v)

Clear the outgoing edges of a vertex.

Example:

// Initialize S
forall(const vertex& v, S)
{
if(condition)
{
S.clear(v);
assert(S.empty(v));
}
}

Definition at line 1441 of file VVGraph.hpp.

◆ clear() [3/3]

template<typename VertexContent , typename EdgeContent >
void mgx::VVGraph< VertexContent, EdgeContent >::clear ( iterator  it)

Clear the outgoing edges of a vertex.

Definition at line 1453 of file VVGraph.hpp.

◆ contains()

template<typename VertexContent , typename EdgeContent >
bool mgx::VVGraph< VertexContent, EdgeContent >::contains ( const vertex_t v) const

Test if v is in the graph.

Returns
true is v is in the graph.

Example:

S.insert(v);
assert(S.contains(v));

Definition at line 1703 of file VVGraph.hpp.

◆ count()

template<typename VertexContent , typename EdgeContent >
VVGraph< VertexContent, EdgeContent >::size_type mgx::VVGraph< VertexContent, EdgeContent >::count ( const vertex_t v) const

Count the number of vertexes v in the graph (can be 0 or 1 only)

Definition at line 1463 of file VVGraph.hpp.

◆ edge() [1/2]

template<typename VertexContent , typename EdgeContent >
VVGraph< VertexContent, EdgeContent >::edge_t mgx::VVGraph< VertexContent, EdgeContent >::edge ( const vertex_t src,
const vertex_t tgt 
)

Returns the edge from src to tgt.

If the edge does not exists, returns a null edge.

Example:

struct VertexContent {};
struct EdgeContent { int a; }
typedef VVGraph<VertexContent,EdgeContent> vvGraph;
// ...
// initialize S
forall(const vertex& v, S)
{
forall(const vertex& n, S.neighbors(v))
{
edge e = S.edge(v,n);
e->a = 10;
}
}

Definition at line 1766 of file VVGraph.hpp.

◆ edge() [2/2]

template<typename VertexContent , typename EdgeContent >
VVGraph< VertexContent, EdgeContent >::const_edge_t mgx::VVGraph< VertexContent, EdgeContent >::edge ( const vertex_t src,
const vertex_t tgt 
) const

Returns the edge from src to tgt.

If the edge does not exists, returns a null edge.

Example:

struct VertexContent {};
struct EdgeContent { int a; }
typedef VVGraph<VertexContent,EdgeContent> vvGraph;
typedef vvGraph::const_edge_t const_edge;
// ...
void fct(const vvGraph& S)
{
forall(const vertex& v, S)
{
forall(const vertex& n, S.neighbors(v))
{
const_edge e = S.edge(v,n);
cout << e->a << endl; // Here e->a cannot be modified
}
}
}

Definition at line 1777 of file VVGraph.hpp.

◆ empty() [1/2]

template<typename VertexContent , typename EdgeContent = _EmptyEdgeContent>
bool mgx::VVGraph< VertexContent, EdgeContent >::empty ( ) const
inline

Test if there is any vertex in the graph.

Definition at line 560 of file VVGraph.hpp.

◆ empty() [2/2]

template<typename VertexContent , typename EdgeContent >
bool mgx::VVGraph< VertexContent, EdgeContent >::empty ( const vertex_t v) const

Test if a vertex has a neighbor.

Returns false if it does. If a vertex is not in the graph, it is considered as having no neighbor. In the same way, the null vertex has no neighbors.

Example:

// initialize S
forall(cnst vertex& v, S)
{
if(!S.empty(v))
{
const vertex& n = S.anyIn(v);
// Working with n a neighbor of v
}
}

Definition at line 1562 of file VVGraph.hpp.

◆ end() [1/2]

template<typename VertexContent , typename EdgeContent = _EmptyEdgeContent>
iterator mgx::VVGraph< VertexContent, EdgeContent >::end ( )
inline

Returns an iterator on the end of the set of vertexes of the graph.

Definition at line 1161 of file VVGraph.hpp.

◆ end() [2/2]

template<typename VertexContent , typename EdgeContent = _EmptyEdgeContent>
const_iterator mgx::VVGraph< VertexContent, EdgeContent >::end ( ) const
inline

Returns an iterator on the end of the set of vertexes of the graph.

Definition at line 1174 of file VVGraph.hpp.

◆ erase() [1/2]

template<typename VertexContent , typename EdgeContent >
VVGraph< VertexContent, EdgeContent >::size_type mgx::VVGraph< VertexContent, EdgeContent >::erase ( const vertex_t v)

Remove a vertex from the graph.

Parameters
vvertex to erase
Returns
1 if the vertex was erased, 0 else.

Example:

// Add vertices to S
vertex v = S.any();
S.erase(v); // Remove a vertex of S

Definition at line 1379 of file VVGraph.hpp.

◆ erase() [2/2]

template<typename VertexContent , typename EdgeContent >
void mgx::VVGraph< VertexContent, EdgeContent >::erase ( iterator  pos)

Erase element at position pos.

Definition at line 1366 of file VVGraph.hpp.

◆ eraseAllEdges() [1/4]

template<typename VertexContent , typename EdgeContent >
void mgx::VVGraph< VertexContent, EdgeContent >::eraseAllEdges

Clear all the edges in the graph.

Example:

// Initialize S
vvGraph::size_type s1 = S.size(); // Save the number of vertices
S.eraseAllEdges();
assert(s1 == S.size()); // The number of vertices didn't change
forall(const vertex& v, S)
{
assert(S.empty(v)); // No neighbor
}

Definition at line 1396 of file VVGraph.hpp.

◆ eraseAllEdges() [2/4]

template<typename VertexContent , typename EdgeContent >
bool mgx::VVGraph< VertexContent, EdgeContent >::eraseAllEdges ( const vertex_t v)

Clear the neighborhood of a vertex.

All edges, to and from v will be erased.

Example:

// Initialize S
forall(const vertex& v, S)
{
if(condition)
{
S.eraseAllEdges(v);
assert(S.empty(v)); // No outgoing edges
assert(S.iEmpty(v)); // No incoming edges
}
}

Definition at line 1407 of file VVGraph.hpp.

◆ eraseAllEdges() [3/4]

template<typename VertexContent , typename EdgeContent >
void mgx::VVGraph< VertexContent, EdgeContent >::eraseAllEdges ( iterator  it)

Clear the neighborhood of a vertex.

All edges, to and from *it will be erased.

Definition at line 1434 of file VVGraph.hpp.

◆ eraseAllEdges() [4/4]

template<typename VertexContent , typename EdgeContent >
void mgx::VVGraph< VertexContent, EdgeContent >::eraseAllEdges ( NeighborhoodPair it)
protected

Definition at line 1419 of file VVGraph.hpp.

◆ eraseEdge() [1/3]

template<typename VertexContent , typename EdgeContent >
VVGraph< VertexContent, EdgeContent >::size_type mgx::VVGraph< VertexContent, EdgeContent >::eraseEdge ( const vertex_t src,
const vertex_t tgt 
)

Erase the edge from src to tgt.

Returns
True if successful.

Example:

// Initialize S
forall(const vertex& v, S)
{
forall(const vertex& n, S.neighbors(v))
{
if(condition)
{
S.eraseEdge(v,n);
break; // The iteration must not continue after the neighborhood has been altered
}
}
}

Definition at line 1691 of file VVGraph.hpp.

◆ eraseEdge() [2/3]

template<typename VertexContent , typename EdgeContent >
VVGraph< VertexContent, EdgeContent >::size_type mgx::VVGraph< VertexContent, EdgeContent >::eraseEdge ( const vertex_t v,
circ_neighbor_iterator  pos 
)

Erase the edge pointed to by the iterator.

Definition at line 1683 of file VVGraph.hpp.

◆ eraseEdge() [3/3]

template<typename VertexContent , typename EdgeContent >
VVGraph< VertexContent, EdgeContent >::size_type mgx::VVGraph< VertexContent, EdgeContent >::eraseEdge ( const vertex_t v,
neighbor_iterator  pos 
)

Erase the edge pointed to by the iterator.

Definition at line 1675 of file VVGraph.hpp.

◆ findIn() [1/2]

template<typename VertexContent , typename EdgeContent >
VVGraph< VertexContent, EdgeContent >::neighbor_iterator mgx::VVGraph< VertexContent, EdgeContent >::findIn ( const vertex_t v,
const vertex_t n 
)

Find the vertex n in the neighborhood of v.

Returns
  • An iterator on n in the neighborhood of v, if found
  • An iterator on the end of the neighborhood if n is not found in v
  • Otherwise, the result is undefined

Definition at line 1653 of file VVGraph.hpp.

◆ findIn() [2/2]

template<typename VertexContent , typename EdgeContent >
VVGraph< VertexContent, EdgeContent >::const_neighbor_iterator mgx::VVGraph< VertexContent, EdgeContent >::findIn ( const vertex_t v,
const vertex_t n 
) const

Find the vertex n in the neighborhood of v.

Returns
  • An iterator on n in the neighborhood of v, if found
  • An iterator on the end of the neighborhood if n is not found in v
  • Otherwise, the result is undefined

Definition at line 1664 of file VVGraph.hpp.

◆ findInVertex() [1/2]

template<typename VertexContent , typename EdgeContent >
VVGraph< VertexContent, EdgeContent >::neighbor_found_t mgx::VVGraph< VertexContent, EdgeContent >::findInVertex ( const vertex_t v,
const vertex_t neighbor 
)
protected

Find a vertex neighbor in the neighborhood of v.

If 'v' is in the graph and 'neighbor' is in its neighborhood, the result is convertible to true, 'neighborhood' points toward the neighborhood structure and 'it' points toward the neighbor.

If 'v' is in the graph, but 'neighbor' is not in the neighborhood, the result is convertible to false, 'neighborhood' points toward the neighborhood structure and 'it' is neighborhood->edges.end().

If v is not in the graph, the result is convertible to false and the address of the stored neighborhood is 0.

Definition at line 1613 of file VVGraph.hpp.

◆ findInVertex() [2/2]

template<typename VertexContent , typename EdgeContent >
VVGraph< VertexContent, EdgeContent >::const_neighbor_found_t mgx::VVGraph< VertexContent, EdgeContent >::findInVertex ( const vertex_t v,
const vertex_t neighbor 
) const
protected

Constant version of findInVertex(const vertex_t&, const vertex_t&)

Definition at line 1633 of file VVGraph.hpp.

◆ findIterator() [1/2]

template<typename VertexContent , typename EdgeContent >
VVGraph< VertexContent, EdgeContent >::neighborhood_t::iterator mgx::VVGraph< VertexContent, EdgeContent >::findIterator ( const NeighborhoodPair np)
protected

Find the iterator for a given neighborhood pair.

Definition at line 1575 of file VVGraph.hpp.

◆ findIterator() [2/2]

template<typename VertexContent , typename EdgeContent >
VVGraph< VertexContent, EdgeContent >::neighborhood_t::const_iterator mgx::VVGraph< VertexContent, EdgeContent >::findIterator ( const NeighborhoodPair np) const
protected

Definition at line 1583 of file VVGraph.hpp.

◆ findVertex() [1/2]

template<typename VertexContent , typename EdgeContent >
VVGraph< VertexContent, EdgeContent >::NeighborhoodPair * mgx::VVGraph< VertexContent, EdgeContent >::findVertex ( const vertex_t v)
protected

Find a vertex in the graph and returns the iterator on it.

Definition at line 1591 of file VVGraph.hpp.

◆ findVertex() [2/2]

template<typename VertexContent , typename EdgeContent >
const VVGraph< VertexContent, EdgeContent >::NeighborhoodPair * mgx::VVGraph< VertexContent, EdgeContent >::findVertex ( const vertex_t v) const
protected

Constant version of findVertex(const vertex_t&)

Definition at line 1602 of file VVGraph.hpp.

◆ insert() [1/3]

template<typename VertexContent , typename EdgeContent >
template<typename Iterator >
void mgx::VVGraph< VertexContent, EdgeContent >::insert ( const std::pair< Iterator, Iterator > &  range,
bool  checkUnique = true 
)

Insert all the vertexes from range.first to range.last-1 in the graph.

Definition at line 1490 of file VVGraph.hpp.

◆ insert() [2/3]

template<typename VertexContent , typename EdgeContent >
bool mgx::VVGraph< VertexContent, EdgeContent >::insert ( const vertex_t v,
bool  checkUnique = true 
)

Insert a new vertex in the graph.

Returns
An true if successful, false if vertex was already there

Example:

vertex v; // Create a vertex
S.insert(v); // Insert it in the graph

Definition at line 1470 of file VVGraph.hpp.

◆ insert() [3/3]

template<typename VertexContent , typename EdgeContent >
template<typename Iterator >
void mgx::VVGraph< VertexContent, EdgeContent >::insert ( Iterator  first,
Iterator  last,
bool  checkUnique = true 
)

Insert all the vertexes from first to last-1 in the graph.

Definition at line 1498 of file VVGraph.hpp.

◆ insertEdge()

template<typename VertexContent , typename EdgeContent >
VVGraph< VertexContent, EdgeContent >::edge_t mgx::VVGraph< VertexContent, EdgeContent >::insertEdge ( const vertex_t src,
const vertex_t tgt 
)

Insert a new edge in the graph, without ordering.

If new_neighbor is already in the neighborhood of v, the insertion fails.

Returns
The just created edge if everything succeed, or a null edge.

Example:

vertex v1, v2;
S.insert(v1);
S.insert(v2);
S.insertEdge(v1, v2); // Insert the edge between v1 and v2
S.insertEdge(v2, v1); // Insert the edge between v2 and v1

Definition at line 1823 of file VVGraph.hpp.

◆ isModified()

template<typename VertexContent , typename EdgeContent = _EmptyEdgeContent>
bool mgx::VVGraph< VertexContent, EdgeContent >::isModified ( ) const
inline

Test if vertex list has been modified.

Definition at line 568 of file VVGraph.hpp.

◆ neighbors() [1/4]

template<typename VertexContent , typename EdgeContent >
VVGraph< VertexContent, EdgeContent >::neighbor_iterator_pair mgx::VVGraph< VertexContent, EdgeContent >::neighbors ( const vertex_t v)

Return the range of neighbors of v.

Example:

// initialize S
forall(const vertex& v, S)
{
forall(const vertex& n, S.neighbors(v))
{
// n is a neighbor of v
}
}

Definition at line 1859 of file VVGraph.hpp.

◆ neighbors() [2/4]

template<typename VertexContent , typename EdgeContent >
VVGraph< VertexContent, EdgeContent >::const_neighbor_iterator_pair mgx::VVGraph< VertexContent, EdgeContent >::neighbors ( const vertex_t v) const

Return the constant range of neighbors of v.

Example:

// initialize S
forall(const vertex& v, S)
{
forall(const vertex& n, S.neighbors(v))
{
// n is a neighbor of v
}
}

Definition at line 1842 of file VVGraph.hpp.

◆ neighbors() [3/4]

template<typename VertexContent , typename EdgeContent >
VVGraph< VertexContent, EdgeContent >::circ_neighbor_iterator_pair mgx::VVGraph< VertexContent, EdgeContent >::neighbors ( const vertex_t v,
const vertex_t n 
)

Return the range of neighbors of v, starting at n.

Example:

// initialize S
forall(const vertex& m, S.neighbors(v,n))
{
// m is a neighbor of v
// on the first loop, m == n
}

Definition at line 1893 of file VVGraph.hpp.

◆ neighbors() [4/4]

template<typename VertexContent , typename EdgeContent >
VVGraph< VertexContent, EdgeContent >::const_circ_neighbor_iterator_pair mgx::VVGraph< VertexContent, EdgeContent >::neighbors ( const vertex_t v,
const vertex_t n 
) const

Return the range of neighbors of v, starting at n.

Example:

// initialize S
forall(const vertex& m, S.neighbors(v,n))
{
// m is a neighbor of v
// on the first loop, m == n
}

Definition at line 1876 of file VVGraph.hpp.

◆ nextTo()

template<typename VertexContent , typename EdgeContent >
const VVGraph< VertexContent, EdgeContent >::vertex_t & mgx::VVGraph< VertexContent, EdgeContent >::nextTo ( const vertex_t v,
const vertex_t neighbor,
unsigned int  n = 1 
) const

Returns the nth vertex after neighbor in the neighborhood of v.

Returns
The vertex found or a null vertex if there is any problem.

Example:

// initialize S
forall(const vertex& v, S)
{
forall(const vertex& n, S.neighbors(v))
{
const vertex& m, S.nextTo(v);
// m is the vertex after n in v
}
}

Definition at line 1730 of file VVGraph.hpp.

◆ operator=()

template<typename VertexContent , typename EdgeContent >
VVGraph< VertexContent, EdgeContent > & mgx::VVGraph< VertexContent, EdgeContent >::operator= ( const VVGraph< VertexContent, EdgeContent > &  other)

Copy the graph into another graph.

Definition at line 2007 of file VVGraph.hpp.

◆ operator==()

template<typename VertexContent , typename EdgeContent >
bool mgx::VVGraph< VertexContent, EdgeContent >::operator== ( const VVGraph< VertexContent, EdgeContent > &  other) const

Test equality for the graphs.

Two graphs are equal if they shared the sames vertices and their neighborhood are equivalent.

Note
Current implementation do not consider invariance of neighborhood by rotation.

Definition at line 1955 of file VVGraph.hpp.

◆ operator[]()

template<typename VertexContent , typename EdgeContent >
const VVGraph< VertexContent, EdgeContent >::vertex_t & mgx::VVGraph< VertexContent, EdgeContent >::operator[] ( size_type  idx) const

Return the element of index idx.

Note
This is a convenience function whose complexity if O(idx)
Returns
The element idx position after the first one (using iterators)

Example:

// Fill in S
size_t i = 0, selected = 0;
forall(const vertex& v, S)
{
if(condition(v))
{
selected = i;
break;
}
++i;
}
// ...
const vertex& v = S[selected]; // Work with the vertex previously selected

This construct is useful is case you need to refer to your vertices by 32bits numbers. It is true if you use selection with OpenGL for example.

Definition at line 1526 of file VVGraph.hpp.

◆ prevTo()

template<typename VertexContent , typename EdgeContent >
const VVGraph< VertexContent, EdgeContent >::vertex_t & mgx::VVGraph< VertexContent, EdgeContent >::prevTo ( const vertex_t v,
const vertex_t ref,
unsigned int  n = 1 
) const

Returns the nth vertex before ref in the neighborhood of v.

If ref is not in the neighborhood of v, return a null vertex.

Example:

// initialize S
forall(const vertex& v, S)
{
forall(const vertex& n, S.neighbors(v))
{
const vertex& m, S.prevTo(v);
// m is the vertex before n in v
}
}

Definition at line 1748 of file VVGraph.hpp.

◆ reference()

template<typename VertexContent , typename EdgeContent = _EmptyEdgeContent>
const vertex_t& mgx::VVGraph< VertexContent, EdgeContent >::reference ( vertex_t  v) const
inline

Get a reference on the vertex in the graph.

If the vertex does not exist in the graph, the function returns a null vertex.

Example:

vvGraph S1, S2;
// Initialize S1 and S2 with the same vertices but different neighborhood
forall(const vertex& v1, S1)
{
const vertex& v2 = S2.reference(v1);
// Use v2 in S2 and v1 in v1 for speed optimizatioN
}

Definition at line 541 of file VVGraph.hpp.

◆ replace()

template<typename VertexContent , typename EdgeContent >
VVGraph< VertexContent, EdgeContent >::edge_t mgx::VVGraph< VertexContent, EdgeContent >::replace ( const vertex_t v,
const vertex_t neighbor,
const vertex_t new_neighbor 
)

Replace a vertex by another in a neighborhood.

Parameters
[in]vVertex whose neighborhood is changed.
[in]neighborVertex to replace
[in]new_neighborVertex replacing neighbor

If new_neighbor is already in the neighborhood of v, then the operation fails and nothing is changed.

Returns
The edge between v and new_neighbor or a null edge if anything goes wrong.

Example:

// Initialize S
forall(const vertex& v, S)
{
forall(const vertex& n, S.neighbors(v))
{
if(condition)
{
vertex n1;
S.replace(v,n,n1); // Now n1 is where n was in v
break; // The iteration must not continue after the neighborhood has been altered
}
}
}

Definition at line 1711 of file VVGraph.hpp.

◆ reserve()

template<typename VertexContent , typename EdgeContent = _EmptyEdgeContent>
void mgx::VVGraph< VertexContent, EdgeContent >::reserve ( size_type  s)
inline

Reserve space for more vertices.

Definition at line 1219 of file VVGraph.hpp.

◆ reverse()

template<typename VertexContent , typename EdgeContent >
VVGraph< VertexContent, EdgeContent > & mgx::VVGraph< VertexContent, EdgeContent >::reverse

Reverse the order of all the neighbors.

Definition at line 1996 of file VVGraph.hpp.

◆ setModified()

template<typename VertexContent , typename EdgeContent = _EmptyEdgeContent>
void mgx::VVGraph< VertexContent, EdgeContent >::setModified ( bool  _modified)
inline

Set modified status.

Definition at line 576 of file VVGraph.hpp.

◆ size()

template<typename VertexContent , typename EdgeContent = _EmptyEdgeContent>
size_type mgx::VVGraph< VertexContent, EdgeContent >::size ( ) const
inline

Return the number of vertexes on the graph.

Definition at line 552 of file VVGraph.hpp.

◆ source()

template<typename VertexContent , typename EdgeContent = _EmptyEdgeContent>
const vertex_t& mgx::VVGraph< VertexContent, EdgeContent >::source ( const edge_t edge) const
inline

Return the source vertex of the edge.

Example:

void fct(edge e, const vvGraph& S)
{
const vertex& src = S.source(e);
const vertex& tgt = S.target(e);
// Work with the vertices
}

Definition at line 829 of file VVGraph.hpp.

◆ spliceAfter()

template<typename VertexContent , typename EdgeContent >
VVGraph< VertexContent, EdgeContent >::edge_t mgx::VVGraph< VertexContent, EdgeContent >::spliceAfter ( const vertex_t v,
const vertex_t neighbor,
const vertex_t new_neighbor 
)

Insert neighbor in the neighborhood of v after reference.

If new_neighbor is already in the neighborhood of v, the insertion fails.

Returns
The just created edge if everything succeed, or a null edge.

Example:

// Initialize S
forall(const vertex& v, S)
{
forall(const vertex& n, S.neighbors(v))
{
if(condition)
{
vertex n1;
S.spliceAfter(v,n,n1); // Now n1 is after n in v
break; // The iteration must not continue after the neighborhood has been altered
}
}
}

Definition at line 1788 of file VVGraph.hpp.

◆ spliceBefore()

template<typename VertexContent , typename EdgeContent >
VVGraph< VertexContent, EdgeContent >::edge_t mgx::VVGraph< VertexContent, EdgeContent >::spliceBefore ( const vertex_t v,
const vertex_t neighbor,
const vertex_t new_neighbor 
)

Insert neighbor in the neighborhood of v before reference.

If new_neighbor is already in the neighborhood of v, the , checkUnique = trueinsertion fails.

Returns
The just created edge if everything succeed, or a null edge.

Example:

// Initialize S
forall(const vertex& v, S)
{
forall(const vertex& n, S.neighbors(v))
{
if(condition)
{
vertex n1;
S.spliceBefore(v,n,n1); // Now n1 is before n in v
break; // The iteration must not continue after the neighborhood has been altered
}
}
}

Definition at line 1806 of file VVGraph.hpp.

◆ subgraph() [1/2]

template<typename VertexContent , typename EdgeContent = _EmptyEdgeContent>
template<typename VertexContainer >
VVGraph mgx::VVGraph< VertexContent, EdgeContent >::subgraph ( const VertexContainer &  vertexes) const

Extract the subgraph containing the vertexes.

The subgraph is the set of vertexes and the edges whose source and target are in the extracted vertexes.

Example:

// Initialize S
std::vector<vertex> to_keep;
// Fill in to_keep with a subset of the vertices of S
vvGraph S1 = S.subgraph(to_keep);

◆ subgraph() [2/2]

template<typename VertexContent , typename EdgeContent = _EmptyEdgeContent>
template<typename VertexContainer >
VVGraph<VertexContent, EdgeContent> mgx::VVGraph< VertexContent, EdgeContent >::subgraph ( const VertexContainer &  verts) const

Definition at line 1911 of file VVGraph.hpp.

◆ swap()

template<typename VertexContent , typename EdgeContent >
void mgx::VVGraph< VertexContent, EdgeContent >::swap ( VVGraph< VertexContent, EdgeContent > &  other)

Swap the content of both graphs.

Definition at line 2028 of file VVGraph.hpp.

◆ target()

template<typename VertexContent , typename EdgeContent = _EmptyEdgeContent>
const vertex_t& mgx::VVGraph< VertexContent, EdgeContent >::target ( const edge_t edge) const
inline

Return the target vertex of the edge.

Example:

void fct(edge e, const vvGraph& S)
{
const vertex& src = S.source(e);
const vertex& tgt = S.target(e);
// Work with the vertices
}

Definition at line 850 of file VVGraph.hpp.

◆ uniqueLine()

template<typename VertexContent , typename EdgeContent >
bool mgx::VVGraph< VertexContent, EdgeContent >::uniqueLine ( const vertex_t v,
const vertex_t n 
) const

Test for unique line.

Only true for one of (v,n) or (n,v). Only use in graphs that always have edges in both directions.

Definition at line 2046 of file VVGraph.hpp.

◆ uniqueTri()

template<typename VertexContent , typename EdgeContent >
bool mgx::VVGraph< VertexContent, EdgeContent >::uniqueTri ( const vertex_t v,
const vertex_t n,
const vertex_t m 
) const

Test for unique triangle.

Only true for one of (v,n,m) (n,m,v) or (m,v,n). Only for use with triangle meshes.

Definition at line 2036 of file VVGraph.hpp.

◆ valence()

template<typename VertexContent , typename EdgeContent >
VVGraph< VertexContent, EdgeContent >::size_type mgx::VVGraph< VertexContent, EdgeContent >::valence ( const vertex_t v) const

Returns the number of neighbors of v.

If v is not in the graph, the behavior is undefined.

Example:

// initialize S
forall(const vertex& v, S)
{
size_t nb_neighbors = S.valence(v); // Number of neighbors of v in S
// ...
}

Definition at line 1550 of file VVGraph.hpp.

Member Data Documentation

◆ lookup

template<typename VertexContent , typename EdgeContent = _EmptyEdgeContent>
lookup_t mgx::VVGraph< VertexContent, EdgeContent >::lookup
protected

Hash map to optimise look-up.

Definition at line 1340 of file VVGraph.hpp.

◆ modified

template<typename VertexContent , typename EdgeContent = _EmptyEdgeContent>
bool mgx::VVGraph< VertexContent, EdgeContent >::modified
protected

If true, the vertex list has been modified.

Definition at line 1345 of file VVGraph.hpp.

◆ neighborhood

template<typename VertexContent , typename EdgeContent = _EmptyEdgeContent>
neighborhood_t mgx::VVGraph< VertexContent, EdgeContent >::neighborhood
protected

Main data structure containing everything.

Definition at line 1335 of file VVGraph.hpp.


The documentation for this class was generated from the following file:
mgx::VVGraph< VertexData, EdgeData >::edge_t
Edge< EdgeData > edge_t
Weak pointer on an edge.
Definition: VVGraph.hpp:174
mgx::vertex
vvGraph::vertex_t vertex
Type of a vertex.
Definition: Misc.hpp:50
forall
#define forall
Definition: Forall.hpp:22
n
#define n
Definition: Eigenvalues.hpp:36
mgx::VVGraph< VertexData, EdgeData >::size_type
neighborhood_t::size_type size_type
Type of a size.
Definition: VVGraph.hpp:360
mgx::vvGraph
VVGraph< VertexData, EdgeData > vvGraph
Simpler names for the various containers and iterators related to vertices and VV.
Definition: Misc.hpp:47
mgx::VVGraph::edge
edge_t edge(const vertex_t &src, const vertex_t &tgt)
Returns the edge from src to tgt.
Definition: VVGraph.hpp:1766
mgx::VVGraph::subgraph
VVGraph subgraph(const VertexContainer &vertexes) const
Extract the subgraph containing the vertexes.
mgx::VVGraph< VertexData, EdgeData >::vertex_t
Vertex< VertexData > vertex_t
Smart pointer on a vertex.
Definition: VVGraph.hpp:170
mgx::VVGraph< VertexData, EdgeData >::const_edge_t
Edge< const EdgeData > const_edge_t
Weak pointer on a constant edge.
Definition: VVGraph.hpp:178