FilterNodes
Declared in lemon/adaptors.h, in the group Adaptor Classes for Graphs; the same class on the Doxygen site.
-
template< typename GR , typename NF >
class FilterNodes Adaptor class for hiding nodes in a digraph or a graph.
FilterNodes adaptor can be used for hiding nodes in a digraph or a graph. A
boolnode map must be specified, which defines the filter for the nodes. Only the nodes withtruefilter value and the arcs/edges incident to nodes both withtruefilter value are shown in the subgraph. This adaptor conforms to the Digraph concept or the Graph concept depending on theGRtemplate parameter.The adapted (di)graph can also be modified through this adaptor by adding or removing nodes or arcs/edges, unless the
GRtemplate parameter is set to beconst.This class provides only linear time item counting.
Note
The
NodeandArc/Edgetypes of this adaptor and the adapted (di)graph are convertible to each other.- Template Parameters:
GR – The type of the adapted digraph or graph. It must conform to the Digraph concept or the Graph 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 (di)graph. The default type is GR::NodeMap< bool >.
Public Functions
-
inline FilterNodes( GR & graph , NF & node_filter )
Constructor.
Creates a subgraph for the given digraph or graph with the given node filter map.
-
inline FilterNodes( const FilterNodes & other )
Copy constructor.
Creates an adaptor of the same digraph or graph with the same node filter map, which refers to none of the members of
other.
-
inline FilterNodes & operator=( const FilterNodes & other )
Assignment.
Makes this adaptor adapt the digraph or graph of
otherwith its node filter map.
-
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 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 void disable( const Node & n ) const
Disables the given node.
This function disables the given node, so the iteration jumps over it. It is the same as status(n, false).
-
inline void enable( const Node & n ) const
Enables the given node.
This function enables the given node. It is the same as status(n, true).
Protected Functions
-
inline FilterNodes()
-
template< typename GR , typename NF >
class FilterNodes< GR , NF , typename enable_if< UndirectedTagIndicator< GR > >::type > : public lemon::GraphAdaptorExtender< SubGraphBase< GR , NF , ConstMap< GR::Edge , Const< bool , true > > , true > > Public Types
-
typedef Parent::Node Node
Public Functions
-
inline FilterNodes( GR & graph , NodeFilterMap & node_filter )
-
inline FilterNodes( const FilterNodes & other )
-
inline FilterNodes & operator=( const FilterNodes & other )
Protected Functions
-
inline FilterNodes()
-
FilterNodes< const GR , NF > filterNodes( const GR & graph , NF & node_filter )
Returns a read-only FilterNodes adaptor.
This function just returns a read-only FilterNodes adaptor.
-
typedef Parent::Node Node