|
Adiar 2.1.0
An External Memory Decision Diagram Library
|
#include <adiar/internal/dd.h>
Public Types | |
| using | node_type = node |
| Type of nodes of this diagram. | |
| using | shared_node_file_type = shared_levelized_file< node_type > |
| Type of the file object node-based representation of a diagram. | |
| using | pointer_type = node_type::pointer_type |
| Type of pointers of this diagram. | |
| using | label_type = node_type::label_type |
| Type of this node's variable label. | |
| using | signed_label_type = node_type::signed_label_type |
| Type for difference between variable labels. | |
| using | arc_type = arc |
| Type of nodes of this diagram. | |
| using | shared_arc_file_type = shared_levelized_file< arc_type > |
| Type of the file object arc-based representation of a diagram. | |
Public Member Functions | |
| __dd ()=default | |
| Default construction to nothing. | |
| __dd (const shared_node_file_type &f) | |
| Conversion for algorithms returning already-reduced nodes. | |
| __dd (const shared_arc_file_type &f, const exec_policy &ep) | |
| Conversion for algorithms returning to-be reduced arcs. | |
| __dd (const dd &dd) | |
| Conversion from a decision diagram (such that it can be passed along). | |
| template<typename file_t > | |
| bool | has () const |
| Whether the union currently holds a certain file type. | |
| template<typename file_t > | |
| const file_t & | get () const |
| Get the content of a certain type. | |
| bool | empty () const |
| Whether it currently holds no content. | |
| size_t | size () const |
| Number of nodes. | |
| cut::size_type | max_1level_cut (const cut ct) const |
| Obtain the 1-level cut of the desired type, i.e. of the sub-graph including the desired type of arcs. | |
| cut::size_type | max_2level_cut (const cut ct) const |
| Obtain the 2-level cut of the desired type, i.e. of the sub-graph including the desired type of arcs. | |
| size_t | number_of_terminals (const bool value) const |
| Number of terminals of a certain value. | |
| size_t | number_of_terminals () const |
| Number of terminals. | |
Public Attributes | |
| std::variant< no_file, shared_node_file_type, shared_arc_file_type > | _union |
| Union of levelized node or arc files to reflect the possible return types of a function and a 'no_file' for 'error'. | |
| bool | _negate = false |
Propagation of the dd.negate flag. | |
| signed_label_type | _shift = 0 |
Propagation of the dd.negate flag. | |
| exec_policy | _policy |
| Copy of the execution policy given to the top-down algorithm. | |
An algorithm may return a node-based decision diagram in a shared_levelized_file<node> or a yet to-be reduced decision diagram in in an shared_levelized_file<arc>. So, we use a std::variant to hold the shared_levelized_file<node> or shared_levelized_file<arc> without having to pay for the expensive constructors and use a lot of space.
A third possiblity is for it to contain a std::monostate, i.e. no_file, such that an algorithm can return 'null' in some specific places. In most cases, this should be ignored and will otherwise lead to exceptions.
|
inline |
Whether it currently holds no content.
The end user should not see this in the end.
Get the content of a certain type.
has<file_t>() == true Obtain the 1-level cut of the desired type, i.e. of the sub-graph including the desired type of arcs.
| ct | The type of the cut to obtain |
Obtain the 2-level cut of the desired type, i.e. of the sub-graph including the desired type of arcs.
| ct | The type of the cut to obtain |