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

Reduced Ordered Zero-suppressed Decision Diagram. More...

#include <adiar/zdd/zdd.h>

Inheritance diagram for adiar::zdd:
[legend]
Collaboration diagram for adiar::zdd:
[legend]

Public Types

using node_type = node
 Type of nodes of this 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 id_type = node_type::id_type
 Type of this node's level identifier.
 
using terminal_type = typename node_type::terminal_type
 Type of a terminal value.
 
using node_file_type = levelized_file< node_type >
 File type for the file object representing the diagram.
 
using shared_node_file_type = shared_file_ptr< node_file_type >
 File type for the shared file object representing the diagram.
 

Public Member Functions

 zdd ()
 Default construction, creating the empty set Ø. More...
 
 zdd (terminal_type t)
 Implicit conversion from a terminal value to respectively construct Ø and {Ø} from respectively 0 and 1. More...
 
 zdd (const zdd &oA)
 Copy construction, incrementing thre reference count on the file underneath.
 
 zdd (zdd &&A)
 Move construction, taking over ownership of the files underneath.
 
 zdd (__zdd &&A)
 Implicit move conversion from a possibly to-be reduced result from an algorithm to a zdd. More...
 
zddoperator= (const zdd &other)
 Assigns new zdd.
 
zddoperator= (__zdd &&other)
 Assigns new zdd to a variable; the content is derefenced before the given __zdd is reduced into a zdd.
 
zddoperator&= (const zdd &other)
 
zddoperator*= (const zdd &other)
 
zddoperator|= (const zdd &other)
 
zddoperator+= (const zdd &other)
 
zddoperator-= (const zdd &other)
 
const shared_node_file_type file_ptr () const
 Read-only access to the raw files and meta information.
 
const node_file_typeoperator-> () const
 Read-only access to the members of the raw files and meta information, i.e. this is similar to writing .file_ptr()->.
 
bool is_negated () const
 Read-only access to the negation flag.
 
signed_label_type shift () const
 Read-only access to the number of levels to shift.
 
size_t size () const
 The number of elements in the node file.
 
size_t width () const
 The number of nodes on the widest level.
 
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.
 

Static Public Attributes

static constexpr label_type max_label = node_type::max_label
 The maximal possible value for a unique identifier's label.
 
static constexpr id_type max_id = node_type::max_id
 The maximal possible value for this nodes level identifier.
 

Protected Member Functions

void deref ()
 Release the claim on the underlying file, thereby decreasing its reference counter. If this is the sole owner of that file object, then that object is destructed together with the physical files on disk (if temporary).
 

Protected Attributes

shared_node_file_type _file
 The file describing the actual DAG of the decision diagram.
 
bool _negate = false
 Whether to negate the leaves when reading nodes from the file.
 
signed_label_type _shift = 0
 Number of levels to shift by.
 

Detailed Description

Reduced Ordered Zero-suppressed Decision Diagram.

Remarks
To ensure the most disk-space is available, try to garbage collect objects of this type as quickly as possible and/or minimise the number of lvalues of this type.

Constructor & Destructor Documentation

◆ zdd() [1/3]

adiar::zdd::zdd ( )

Default construction, creating the empty set Ø.

See also
zdd_empty

◆ zdd() [2/3]

adiar::zdd::zdd ( terminal_type  t)

Implicit conversion from a terminal value to respectively construct Ø and {Ø} from respectively 0 and 1.

See also
zdd_terminal, zdd_empty, zdd_null

◆ zdd() [3/3]

adiar::zdd::zdd ( __zdd &&  A)

Implicit move conversion from a possibly to-be reduced result from an algorithm to a zdd.

Since the adiar::internal::reduce algorithm is run as part of this constructor, the scoping rules ensure we garbage collect irrelevant files as early as possible.

Remarks
Since the value o is forced to be moved, we force the content of o to be destructed after finishing the Reduce algorithm.

Member Function Documentation

◆ operator&=()

zdd& adiar::zdd::operator&= ( const zdd other)
See also
zdd_intsec

◆ operator*=()

zdd& adiar::zdd::operator*= ( const zdd other)
See also
zdd_union

◆ operator+=()

zdd& adiar::zdd::operator+= ( const zdd other)
See also
zdd_union

◆ operator-=()

zdd& adiar::zdd::operator-= ( const zdd other)
See also
zdd_diff

◆ operator|=()

zdd& adiar::zdd::operator|= ( const zdd other)
See also
zdd_union

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