ADS
Algorithms and Data Structures
Loading...
Searching...
No Matches
ADS::lemon_interop::GraphView< GR, LM > Class Template Reference

a digraph of LEMON and a length map as a GRAPH of ADS, with no copy, the names of the nodes their ids More...

#include <ADS/interop/lemon/Digraphs.h>

Public types

using Weight = typename LM::Value
 the type of the weights

Public member functions

 GraphView (const GR &g, const LM &l)
 the view of \( g \) with the lengths \( l \), which must outlive it
int n (void) const
 the number of nodes, counted in \( O( n ) \) unless the graph knows it
int bound (void) const
 the names are in \( [ 0 , \mathrm{bound}() ) \), maxNodeId() + 1
bool directed (void) const
 oriented, as the digraphs of LEMON
bool hasNode (int u) const
 whether \( u \) is the id of a node
std::vector< int > V (void) const
 the ids of the nodes
template<class F>
void forEachAdj (int u, F &&f) const
 \( f( v ) \) for the head \( v \) of each arc out of \( u \)
template<class F>
void forEachEdge (int u, F &&f) const
 \( f( v , w ) \) for each arc \( ( u , v ) \) of length \( w \)
std::vector< int > adj (int u) const
 the heads of the arcs out of \( u \)
const GR & digraph (void) const
 the digraph of LEMON

Detailed description

template<class GR, class LM>
class ADS::lemon_interop::GraphView< GR, LM >

a digraph of LEMON and a length map as a GRAPH of ADS, with no copy, the names of the nodes their ids

Member typedef documentation

◆ Weight

template<class GR, class LM>
using ADS::lemon_interop::GraphView< GR, LM >::Weight = typename LM::Value

the type of the weights

Constructor and destructor documentation

◆ GraphView()

template<class GR, class LM>
ADS::lemon_interop::GraphView< GR, LM >::GraphView ( const GR & g,
const LM & l )
inline

the view of \( g \) with the lengths \( l \), which must outlive it

Member function documentation

◆ adj()

template<class GR, class LM>
std::vector< int > ADS::lemon_interop::GraphView< GR, LM >::adj ( int u) const
inlinenodiscard

the heads of the arcs out of \( u \)

Precondition
\( u \) is a node

◆ bound()

template<class GR, class LM>
int ADS::lemon_interop::GraphView< GR, LM >::bound ( void ) const
inlinenodiscard

the names are in \( [ 0 , \mathrm{bound}() ) \), maxNodeId() + 1

◆ digraph()

template<class GR, class LM>
const GR & ADS::lemon_interop::GraphView< GR, LM >::digraph ( void ) const
inlinenodiscard

the digraph of LEMON

◆ directed()

template<class GR, class LM>
bool ADS::lemon_interop::GraphView< GR, LM >::directed ( void ) const
inlinenodiscard

oriented, as the digraphs of LEMON

◆ forEachAdj()

template<class GR, class LM>
template<class F>
void ADS::lemon_interop::GraphView< GR, LM >::forEachAdj ( int u,
F && f ) const
inline

\( f( v ) \) for the head \( v \) of each arc out of \( u \)

Precondition
\( u \) is a node

◆ forEachEdge()

template<class GR, class LM>
template<class F>
void ADS::lemon_interop::GraphView< GR, LM >::forEachEdge ( int u,
F && f ) const
inline

\( f( v , w ) \) for each arc \( ( u , v ) \) of length \( w \)

Precondition
\( u \) is a node

◆ hasNode()

template<class GR, class LM>
bool ADS::lemon_interop::GraphView< GR, LM >::hasNode ( int u) const
inlinenodiscard

whether \( u \) is the id of a node

◆ n()

template<class GR, class LM>
int ADS::lemon_interop::GraphView< GR, LM >::n ( void ) const
inlinenodiscard

the number of nodes, counted in \( O( n ) \) unless the graph knows it

◆ V()

template<class GR, class LM>
std::vector< int > ADS::lemon_interop::GraphView< GR, LM >::V ( void ) const
inlinenodiscard

the ids of the nodes


The documentation for this class was generated from the following file: