TdZdd  1.1
A top-down/breadth-first decision diagram manipulation framework
Public Member Functions | Friends | List of all members
tdzdd::DdSpecBase< S, AR > Class Template Reference

Base class of DD specs. More...

#include <DdSpec.hpp>

Public Member Functions

std::vector< std::pair< int, int > > findOneInstance () const
 Returns a random instance using simple depth-first search without caching. More...
 
void dumpDot (std::ostream &os=std::cout, std::string title=typenameof< S >()) const
 Dumps the diagram in Graphviz (DOT) format. More...
 
std::string dot (std::string title=typenameof< S >()) const
 Makes an input code for Graphviz. More...
 

Friends

std::ostream & operator<< (std::ostream &os, DdSpecBase const &o)
 Dumps the node table in Graphviz (dot) format. More...
 

Detailed Description

template<typename S, int AR>
class tdzdd::DdSpecBase< S, AR >

Base class of DD specs.

Every implementation must have the following functions:

Optionally, the following functions can be overloaded:

A return code of get_root(void*) or get_child(void*, int, bool) is: 0 when the node is the 0-terminal, -1 when it is the 1-terminal, or the node level when it is a non-terminal. A return code of merge_states(void*, void*) is: 0 when the states are merged into the first one, 1 when they cannot be merged and the first one should be forwarded to the 0-terminal, 2 when they cannot be merged and the second one should be forwarded to the 0-terminal.

Template Parameters
Sthe class implementing this class.
ARarity of the nodes.

Definition at line 68 of file DdSpec.hpp.

Member Function Documentation

◆ dot()

template<typename S, int AR>
std::string tdzdd::DdSpecBase< S, AR >::dot ( std::string  title = typenameof<S>()) const
inline

Makes an input code for Graphviz.

Parameters
titletitle label.
Returns
DOT code

Definition at line 112 of file DdSpec.hpp.

◆ dumpDot()

template<typename S, int AR>
void tdzdd::DdSpecBase< S, AR >::dumpDot ( std::ostream &  os = std::cout,
std::string  title = typenameof<S>() 
) const
inline

Dumps the diagram in Graphviz (DOT) format.

Parameters
osthe output stream.
titletitle label.

Definition at line 101 of file DdSpec.hpp.

Referenced by tdzdd::DdSpecBase< HamiltonCycleZdd, AR >::dot().

◆ findOneInstance()

template<typename S, int AR>
std::vector<std::pair<int,int> > tdzdd::DdSpecBase< S, AR >::findOneInstance ( ) const
inline

Returns a random instance using simple depth-first search without caching.

It does not guarantee that the selection is uniform. merge_states(void*, void*) is not supported.

Returns
a collection of (item, value) pairs.
Exceptions
std::runtime_errorno instance exists.

Definition at line 92 of file DdSpec.hpp.

Referenced by tdzdd::DdSpecBase< HamiltonCycleZdd, AR >::findOneInstance().

Friends And Related Function Documentation

◆ operator<<

template<typename S, int AR>
std::ostream& operator<< ( std::ostream &  os,
DdSpecBase< S, AR > const &  o 
)
friend

Dumps the node table in Graphviz (dot) format.

Parameters
osthe output stream.
othe ZDD.
Returns
os itself.

Definition at line 124 of file DdSpec.hpp.


The documentation for this class was generated from the following file: