FilterArcs

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

template< typename DGR , typename AF >
class FilterArcs

Adaptor class for hiding arcs in a digraph.

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.

Note

The Node and Arc types of this adaptor and the adapted digraph are convertible to each other.

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

  • AF – The 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 >.

Public Types

typedef DGR Digraph

The type of the adapted digraph.

typedef AF ArcFilterMap

The type of the arc filter map.

typedef Parent::Arc Arc

Public Functions

inline FilterArcs( DGR & digraph , ArcFilterMap & arc_filter )

Constructor.

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

inline FilterArcs( const FilterArcs & other )

Copy constructor.

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

inline FilterArcs & operator=( const FilterArcs & other )

Assignment.

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

inline void status( const Arc & a , bool v ) const

Sets the status of the given arc.

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.

inline bool status( const Arc & a ) const

Returns the status of the given arc.

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

inline void disable( const Arc & a ) const

Disables the given arc.

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

inline void enable( const Arc & a ) const

Enables the given arc.

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

Protected Functions

inline FilterArcs()

Protected Attributes

ConstMap< typename DGR::Node , Const< bool , true > > const_true_map