1 #ifndef ADIAR_ZDD_ZDD_H
2 #define ADIAR_ZDD_ZDD_H
6 #include <adiar/internal/cut.h>
7 #include <adiar/internal/dd.h>
84 static constexpr std::string_view false_print =
"Ø";
89 static constexpr std::string_view true_print =
"{Ø}";
150 internal::cut::size_type
151 max_1level_cut(
const internal::cut ct)
const
153 return add_false_cofactor(ct, this->
_file->max_1level_cut);
162 internal::cut::size_type
163 max_2level_cut(
const internal::cut ct)
const
165 return add_false_cofactor(ct, this->
_file->max_2level_cut);
175 internal::cut::size_type
176 add_false_cofactor(
const internal::cut ct,
const internal::cuts_t& ilevel_cuts)
const
178 const internal::safe_size_t cut_size = ilevel_cuts[ct];
182 constexpr
size_t bit_mask = internal::cut::Internal_True;
183 const internal::cut ct_excl_false =
static_cast<internal::cut
>(ct & bit_mask);
196 const size_t add_suppressed = !ct.includes(
false) && cut_size == ilevel_cuts[ct_excl_false];
198 return internal::to_size(cut_size + add_suppressed);
A (possibly unreduced) Zero-suppressed Decision Diagram.
Definition: zdd.h:24
__zdd()
Default constructor with an empty result.
__zdd(const zdd &zdd)
Conversion constructor from a bdd to pass along a prior value.
__zdd(const shared_arc_file_type &f, const exec_policy &ep)
Wrapper for an algorithm's unreduced output.
__zdd(const shared_node_file_type &f)
Wrapper for an algorithm's already reduced output.
Settings to dictate the execution of Adiar's algorithms.
Definition: exec_policy.h:35
shared_levelized_file< arc_type > shared_arc_file_type
Type of the file object arc-based representation of a diagram.
Definition: dd.h:80
shared_levelized_file< node_type > shared_node_file_type
Type of the file object node-based representation of a diagram.
Definition: dd.h:55
Container for the files that represent a Decision Diagram.
Definition: dd.h:265
shared_file_ptr< node_file_type > shared_node_file_type
File type for the shared file object representing the diagram.
Definition: dd.h:317
node_type::signed_label_type signed_label_type
Type for difference between variable labels.
Definition: dd.h:287
node_type::label_type label_type
Type of this node's variable label.
Definition: dd.h:282
signed_label_type shift() const
Read-only access to the number of levels to shift.
Definition: dd.h:415
shared_node_file_type _file
The file describing the actual DAG of the decision diagram.
Definition: dd.h:325
typename node_type::terminal_type terminal_type
Type of a terminal value.
Definition: dd.h:307
Reduced Ordered Zero-suppressed Decision Diagram.
Definition: zdd.h:62
zdd & operator*=(const zdd &other)
zdd & operator+=(const zdd &other)
friend size_t zdd_nodecount(const zdd &)
The number of (internal) nodes used to represent the family of sets.
zdd(terminal_type t)
Implicit conversion from a terminal value to respectively construct Ø and {Ø} from respectively 0 and...
friend bool zdd_subseteq(const exec_policy &ep, const zdd &, const zdd &)
Whether one family is a subset or equal to the other.
friend label_type zdd_varcount(const zdd &)
The number of variables that exist in the family of sets, i.e. the number of levels in the ZDD.
friend bool zdd_disjoint(const exec_policy &ep, const zdd &, const zdd &)
Whether the two families are disjoint.
zdd(__zdd &&A)
Implicit move conversion from a possibly to-be reduced result from an algorithm to a zdd.
zdd & operator&=(const zdd &other)
zdd(zdd &&A)
Move construction, taking over ownership of the files underneath.
zdd & operator=(__zdd &&other)
Assigns new zdd to a variable; the content is derefenced before the given __zdd is reduced into a zdd...
zdd(const zdd &oA)
Copy construction, incrementing thre reference count on the file underneath.
zdd & operator=(const zdd &other)
Assigns new zdd.
zdd & operator-=(const zdd &other)
zdd()
Default construction, creating the empty set Ø.
zdd & operator|=(const zdd &other)
Core types.
Definition: adiar.h:40