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
depth
andget_level
methods for networks.This view computes the level of each node and also the depth of the network. It implements the network interface methods
get_level
anddepth
. The levels are computed at construction and can be recomputed by calling theupdate
method.Required gate functions:
is
Required network functions:
clear_visited
foreach_child
foreach_output
get_node
set_visited
visited
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.
-