SubDigraph
Declared in lemon/adaptors.h, in the group Adaptor Classes for Graphs; the same class on the Doxygen site.
-
template< typename DGR , typename NF , typename AF >
class SubDigraph Adaptor class for hiding nodes and arcs in a digraph.
SubDigraph can be used for hiding nodes and arcs in a digraph. A
boolnode map and aboolarc map must be specified, which define the filters for nodes and arcs. Only the nodes and arcs withtruefilter value are shown in the subdigraph. The arcs that are incident to hidden nodes are also filtered out. 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
DGRtemplate parameter is set to beconst.This class provides only linear time counting for nodes and arcs.
See also
See also
Note
The
NodeandArctypes 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.NF – The type of the node filter map. It must be a
bool(or convertible) node map of the adapted digraph. The default type is DGR::NodeMap< bool >.AF – The type of the arc filter map. It must be
bool(or convertible) arc map of the adapted digraph. The default type is DGR::ArcMap< bool >.
Public Types
-
typedef DigraphAdaptorExtender< SubDigraphBase< DGR , NF , AF , true > > Parent
Public Functions
-
inline SubDigraph( DGR & digraph , NF & node_filter , AF & arc_filter )
Constructor.
Creates a subdigraph for the given digraph with the given node and arc filter maps.
-
inline void status( const Node & n , bool v ) const
Sets the status of the given node.
This function sets the status of the given node. It is done by simply setting the assigned value of
ntovin the node 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
atovin the arc filter map.
-
inline bool status( const Node & n ) const
Returns the status of the given node.
This function returns the status of the given node. It is
trueif the given node is enabled (i.e. not hidden).
-
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
trueif the given arc is enabled (i.e. not hidden).
-
inline void disable( const Node & n ) const
Disables the given node.
This function disables the given node in the subdigraph, so the iteration jumps over it. It is the same as status(n, false).
-
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 Node & n ) const
Enables the given node.
This function enables the given node in the subdigraph. It is the same as status(n, true).
-
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 SubDigraph()