Adiar  2.1.0
An External Memory Decision Diagram Library
Variable Domain

Global domain of variables. More...

Typedefs

using adiar::domain_var = internal::node::label_type
 The variable type of a domain variable.
 

Functions

void adiar::domain_set (const domain_var varcount)
 Set the domain globally for all of Adiar to be [0, varcount).
 
void adiar::domain_set (const generator< domain_var > &dom)
 Set the domain globally for all of Adiar to be the variables produced by the given generator function. More...
 
template<typename ForwardIt >
void adiar::domain_set (ForwardIt begin, ForwardIt end)
 Set the domain globally for all of Adiar to be the variables in the given range of iterators. More...
 
void adiar::domain_set (const internal::shared_file< domain_var > &dom)
 Set the domain globally for all of Adiar. More...
 
void adiar::domain_unset ()
 Removes any globally shared domain variables (if any). More...
 
bool adiar::domain_isset ()
 Whether Adiar has a global domain.
 
internal::shared_file< domain_varadiar::domain_get ()
 Returns the global domain. More...
 
domain_var adiar::domain_size ()
 The size of the domain. More...
 

Variables

constexpr domain_var adiar::domain_max = internal::node::max_label
 The maximum supported domain variable.
 

Detailed Description

Global domain of variables.

Some operations relate to the entire variable domain. Instead of passing this around explicitly, you may set it once and then Adiar will take care of using it when needed.

Function Documentation

◆ domain_get()

internal::shared_file<domain_var> adiar::domain_get ( )

Returns the global domain.

This may be usable, if one needs to change the domain, but wants to set it back again to the prior value without recreating the entire file.

Precondition
domain_isset() == true
Exceptions
domain_errorIf no domain is set, i.e. domain_isset() == false.
See also
domain_set(const shared_file<domain_var> &dom)

◆ domain_set() [1/3]

void adiar::domain_set ( const generator< domain_var > &  dom)

Set the domain globally for all of Adiar to be the variables produced by the given generator function.

Parameters
domGenerator that produces variables to be quantified in ascending order. When none are left, it must return a value greater than domain_max.

◆ domain_set() [2/3]

void adiar::domain_set ( const internal::shared_file< domain_var > &  dom)

Set the domain globally for all of Adiar.

This may be usable, if one needs to change the domain, but wants to set it back again to the prior value without recreating the entire file.

Parameters
domA shared_file containing all labels of the problem domain in ascending order.
See also
domain_get()

◆ domain_set() [3/3]

template<typename ForwardIt >
void adiar::domain_set ( ForwardIt  begin,
ForwardIt  end 
)

Set the domain globally for all of Adiar to be the variables in the given range of iterators.

Parameters
beginSingle-pass forward iterator that provides the domain variables in ascending order.
endMarks the end for begin.

◆ domain_size()

domain_var adiar::domain_size ( )

The size of the domain.

Returns 0 if domain_isset() == false.

◆ domain_unset()

void adiar::domain_unset ( )

Removes any globally shared domain variables (if any).

See also
domain_set