Undirector

Declared in lemon/adaptors.h, in the group Adaptor Classes for Graphs; the same class on the Doxygen site.

template< typename DGR >
class Undirector

Adaptor class for viewing a digraph as an undirected graph.

Undirector adaptor can be used for viewing a digraph as an undirected graph. All arcs of the underlying digraph are showed in the adaptor as an edge (and also as a pair of arcs, of course). This adaptor conforms to the Graph concept.

The adapted digraph can also be modified through this adaptor by adding or removing nodes or edges, unless the DGR template parameter is set to be const.

This class provides item counting in the same time as the adapted digraph structure.

Note

The Node type of this adaptor and the adapted digraph are convertible to each other, moreover the Edge type of the adaptor and the Arc type of the adapted digraph are also convertible to each other. (Thus the Arc type of the adaptor is convertible to the Arc type of the adapted digraph.)

Template Parameters:

DGR – The type of the adapted digraph. It must conform to the Digraph concept. It can also be specified to be const.

Public Types

typedef DGR Digraph

The type of the adapted digraph.

Public Functions

inline Undirector( DGR & digraph )

Constructor.

Creates an undirected graph from the given digraph.

Public Static Functions

template< typename FW , typename BK >
static inline CombinedArcMap< FW , BK > combinedArcMap(
FW & forward,
BK & backward
)

Returns a combined arc map.

This function just returns a combined arc map.

template< typename FW , typename BK >
static inline CombinedArcMap< const FW , BK > combinedArcMap(
const FW & forward,
BK & backward
)
template< typename FW , typename BK >
static inline CombinedArcMap< FW , const BK > combinedArcMap(
FW & forward,
const BK & backward
)
template< typename FW , typename BK >
static inline CombinedArcMap< const FW , const BK > combinedArcMap(
const FW & forward,
const BK & backward
)

Protected Functions

inline Undirector()
template< typename FW , typename BK >
class CombinedArcMap

Arc map combined from two original arc maps.

This map adaptor class adapts two arc maps of the underlying digraph to get an arc map of the undirected graph. Its value type is inherited from the first arc map type (FW).

Template Parameters:
  • FW – The type of the “foward” arc map.

  • BK – The type of the “backward” arc map.

Public Types

typedef Parent::Arc Key

The key type of the map.

typedef FW::Value Value

The value type of the map.

typedef MapTraits< FW >::ReferenceMapTag ReferenceMapTag
typedef MapTraits< FW >::ReturnValue ReturnValue
typedef MapTraits< FW >::ConstReturnValue ConstReturnValue
typedef MapTraits< FW >::ReturnValue Reference
typedef MapTraits< FW >::ConstReturnValue ConstReference

Public Functions

inline CombinedArcMap( FW & forward , BK & backward )

Constructor.

inline void set( const Key & e , const Value & a )

Sets the value associated with the given key.

inline ConstReturnValue operator[]( const Key & e ) const

Returns the value associated with the given key.

inline ReturnValue operator[]( const Key & e )

Returns a reference to the value associated with the given key.

Protected Attributes

FW * _forward
BK * _backward