Views¶
Views can modify the implementation of a network interface by
adding interface methods that are not supported by the implementation,
changing the implementation of interface methods, and
deleting interface methods.
Views implement the network interface and can be passed like a network to an algorithm. Several views are implemented in tweedledum.
depth_view: Compute levels and depth¶
Header: tweedledum/views/depth_view.hpp
-
template<typename
Network>
classdepth_view: public tweedledum::immutable_view<Network>¶ Implements
depthandget_levelmethods for networks.This view computes the level of each node and also the depth of the network. It implements the network interface methods
get_levelanddepth. The levels are computed at construction and can be recomputed by calling theupdatemethod.Required gate functions:
is
Required network functions:
clear_visitedforeach_childforeach_outputget_nodeset_visitedvisited
immutable_view: Prevent network changes¶
Header: tweedledum/views/immutable_view.hpp
-
template<typename
Network>
classimmutable_view: public Network¶ Deletes all methods that can change the network.
This view deletes all methods that can change the network structure such as This view is convenient to use as a base class for other views that make some computations based on the structure when being constructed.
Subclassed by tweedledum::depth_view< Network >, tweedledum::pathsum_view< Network >, tweedledum::stats_view< Network >
Public Functions
-
immutable_view(Network const &network)¶ Default constructor.
Constructs immutable view on a network.
-