Views

Views can modify the implementation of a network interface by

  1. adding interface methods that are not supported by the implementation,

  2. changing the implementation of interface methods, and

  3. 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>
class depth_view : public tweedledum::immutable_view<Network>

Implements depth and get_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 and depth. The levels are computed at construction and can be recomputed by calling the update method.

Required gate functions:

  • is

Required network functions:

  • clear_visited

  • foreach_child

  • foreach_output

  • get_node

  • set_visited

  • visited

Public Functions

depth_view(Network &network)

Default constructor.

Constructs depth view on a network.

uint32_t depth() const

Returns the length of the critical path.

uint32_t level(node_type const &node) const

Returns the level of a node.

immutable_view: Prevent network changes

Header: tweedledum/views/immutable_view.hpp

template<typename Network>
class immutable_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.