abLEMON 1.9.0-101-gccb8629
A maintained fork of LEMON
Loading...
Searching...
No Matches
FilterArcs< DGR , AF > Class Template Reference

Adaptor class for hiding arcs in a digraph. More...

#include <lemon/adaptors.h>

Public Types

typedef DGR Digraph
 The type of the adapted digraph.
typedef AF ArcFilterMap
 The type of the arc filter map.

Public Member Functions

 FilterArcs (DGR &digraph, ArcFilterMap &arc_filter)
 Constructor.
 FilterArcs (const FilterArcs &other)
 Copy constructor.
FilterArcs & operator= (const FilterArcs &other)
 Assignment.
void status (const Arc &a, bool v) const
 Sets the status of the given arc.
bool status (const Arc &a) const
 Returns the status of the given arc.
void disable (const Arc &a) const
 Disables the given arc.
void enable (const Arc &a) const
 Enables the given arc.

(Note that these are not member symbols.)

template< typename DGR , typename AF >
FilterArcs< const DGR , AF > filterArcs (const DGR &digraph, AF &arc_filter)
 Returns a read-only FilterArcs adaptor.

Detailed Description

template< typename DGR , typename AF >
class lemon::FilterArcs< DGR , AF >

FilterArcs adaptor can be used for hiding arcs in a digraph. A bool arc map must be specified, which defines the filter for the arcs. Only the arcs with true filter value are shown in the subdigraph. This adaptor conforms to the Digraph concept.

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

This class provides only linear time counting for nodes and arcs.

Template Parameters
DGRThe type of the adapted digraph. It must conform to the Digraph concept. It can also be specified to be const.
AFThe type of the arc filter map. It must be a bool (or convertible) arc map of the adapted digraph. The default type is DGR::ArcMap< bool >.
Note
The Node and Arc types of this adaptor and the adapted digraph are convertible to each other.

Constructor & Destructor Documentation

◆ FilterArcs() [1/2]

template< typename DGR , typename AF >
FilterArcs ( DGR & digraph,
ArcFilterMap & arc_filter )
inline

Creates a subdigraph for the given digraph with the given arc filter map.

◆ FilterArcs() [2/2]

template< typename DGR , typename AF >
FilterArcs ( const FilterArcs< DGR , AF > & other)
inline

Creates an adaptor of the same digraph with the same arc filter map, which refers to none of the members of other.

Member Function Documentation

◆ operator=()

template< typename DGR , typename AF >
FilterArcs & operator= ( const FilterArcs< DGR , AF > & other)
inline

Makes this adaptor adapt the digraph of other with its arc filter map.

◆ status() [1/2]

template< typename DGR , typename AF >
void status ( const Arc & a,
bool v ) const
inline

This function sets the status of the given arc. It is done by simply setting the assigned value of a to v in the arc filter map.

◆ status() [2/2]

template< typename DGR , typename AF >
bool status ( const Arc & a) const
inline

This function returns the status of the given arc. It is true if the given arc is enabled (i.e. not hidden).

◆ disable()

template< typename DGR , typename AF >
void disable ( const Arc & a) const
inline

This function disables the given arc in the subdigraph, so the iteration jumps over it. It is the same as status(a, false).

◆ enable()

template< typename DGR , typename AF >
void enable ( const Arc & a) const
inline

This function enables the given arc in the subdigraph. It is the same as status(a, true).