Adiar  2.1.0
An External Memory Decision Diagram Library
adiar::internal::__dd Class Reference

#include <adiar/internal/dd.h>

Inheritance diagram for adiar::internal::__dd:
[legend]
Collaboration diagram for adiar::internal::__dd:
[legend]

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. More...
 
bool empty () const
 Whether it currently holds no content. More...
 
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. More...
 
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. More...
 
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.
 

Detailed Description

Warning
You should never explicitly be dealing with this class or have it be an l-value. Implicit conversion from an unreduced to the reduced type will call the correct reduce 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.

Member Function Documentation

◆ empty()

bool adiar::internal::__dd::empty ( ) const
inline

Whether it currently holds no content.

The end user should not see this in the end.

◆ get()

template<typename file_t >
const file_t& adiar::internal::__dd::get ( ) const
inline

Get the content of a certain type.

Precondition
has<file_t>() == true

◆ max_1level_cut()

cut::size_type adiar::internal::__dd::max_1level_cut ( const cut  ct) const
inline

Obtain the 1-level cut of the desired type, i.e. of the sub-graph including the desired type of arcs.

Parameters
ctThe type of the cut to obtain

◆ max_2level_cut()

cut::size_type adiar::internal::__dd::max_2level_cut ( const cut  ct) const
inline

Obtain the 2-level cut of the desired type, i.e. of the sub-graph including the desired type of arcs.

Parameters
ctThe type of the cut to obtain

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