This class defines a C++ interface to CUDD's
decicion diagram manager.
More...
#include <CCuddInterface.h>
Public Types | |
typedef CVariableNames | variable_names_type |
Define type for storing names of variables. | |
typedef variable_names_type::const_reference | const_varname_reference |
Define type for getting names of variables. | |
Generic names for related data types | |
typedef CCuddInterface | self |
typedef CCuddCore | core_type |
typedef core_type::mgrcore_ptr | mgrcore_ptr |
typedef CCuddZDD | dd_type |
typedef self | tmp_ref |
Public Member Functions | |
CCuddInterface (size_type numVars=0, size_type numVarsZ=0, size_type numSlots=CUDD_UNIQUE_SLOTS, size_type cacheSize=CUDD_CACHE_SLOTS, unsigned long maxMemory=0) | |
Initialize CUDD-like decision diagram manager. | |
CCuddInterface (const self &rhs) | |
Copy constructor. | |
CCuddInterface (mgrcore_ptr rhs) | |
Construct interface for already initialized manager. | |
~CCuddInterface () | |
Destructor. | |
errorfunc_type | setHandler (errorfunc_type newHandler) |
Define function for error handling. | |
errorfunc_type | getHandler () const |
Extract function for error handling. | |
mgrcore_type | getManager () const |
Get pure CUDD structure. | |
mgrcore_ptr | managerCore () const |
Get (shared) pointer to initialized manager. | |
void | info () const |
Print statistical information. | |
void | checkReturnValue (const node_type result) const |
void | checkReturnValue (const int result) const |
self & | operator= (const self &right) |
Assignment operation. | |
CCuddZDD | zddVar (idx_type idx) const |
Get ZDD variable. | |
CCuddZDD | zddOne (idx_type iMax) const |
Get 1-terminal for ZDDs. | |
CCuddZDD | zddZero () const |
Get 0-terminal for ZDDs. | |
CCuddZDD | zddOne () const |
Get 1-terminal for ZDDs. | |
*void | setName (idx_type idx, const_varname_reference varname) |
Set name of variable with index idx. | |
const_varname_reference | getName (idx_type idx) const |
Get name of variable with index idx. | |
dd_type | getVar (idx_type idx) const |
size_type | nVariables () const |
Get number of managed variables. | |
Manage eloquence | |
void | makeVerbose () |
void | makeTerse () |
bool | isVerbose () const |
Member functions mimicking/interfacing with CUDD procedures | |
int | ReorderingStatusZdd (Cudd_ReorderingType *method) const |
idx_type | ReadPermZdd (idx_type i) const |
idx_type | ReadInvPermZdd (idx_type i) const |
void | AddHook (DD_HFP f, Cudd_HookType where) |
void | RemoveHook (DD_HFP f, Cudd_HookType where) |
int | IsInHook (DD_HFP f, Cudd_HookType where) const |
void | EnableReorderingReporting () |
void | DisableReorderingReporting () |
void | DebugCheck () |
void | CheckKeys () |
void | PrintLinear () |
int | ReadLinear (int x, int y) |
size_type | Prime (size_type pr) const |
void | PrintVersion (FILE *fp) const |
MtrNode * | MakeZddTreeNode (size_type low, size_type size, size_type type) |
void | zddPrintSubtable () const |
void | zddReduceHeap (Cudd_ReorderingType heuristic, int minsize) |
void | zddShuffleHeap (int *permutation) |
void | zddSymmProfile (int lower, int upper) const |
int | SharingSize (dd_type *nodes, int nlen) const |
Protected Member Functions | |
dd_type | getDiagram (node_type result) const |
Convert to decision diagram. | |
dd_type | checkedResult (node_type result) const |
Generate check result of previous node operation and convert. | |
idx_type | checkedResult (idx_type result) const |
Generate check numerical result of previous operation. | |
dd_type | apply (unary_int_function func, idx_type idx) const |
Apply function to given index. | |
dd_type | apply (void_function func) const |
Call function. |
This class defines a C++ interface to CUDD's
decicion diagram manager.
The purpose of this wrapper is just to provide an efficient and save way of handling the decision diagram management. It corrects some short-comings of CUDD's built-in interface.
Define type for getting names of variables.
typedef CCuddCore CCuddInterface::core_type |
typedef CCuddZDD CCuddInterface::dd_type |
typedef CCuddInterface CCuddInterface::self |
typedef self CCuddInterface::tmp_ref |
Define type for storing names of variables.
CCuddInterface::CCuddInterface | ( | size_type | numVars = 0 , |
|
size_type | numVarsZ = 0 , |
|||
size_type | numSlots = CUDD_UNIQUE_SLOTS , |
|||
size_type | cacheSize = CUDD_CACHE_SLOTS , |
|||
unsigned long | maxMemory = 0 | |||
) | [inline] |
Initialize CUDD-like decision diagram manager.
CCuddInterface::CCuddInterface | ( | const self & | rhs | ) | [inline] |
Copy constructor.
CCuddInterface::CCuddInterface | ( | mgrcore_ptr | rhs | ) | [inline] |
Construct interface for already initialized manager.
CCuddInterface::~CCuddInterface | ( | ) | [inline] |
Destructor.
void CCuddInterface::AddHook | ( | DD_HFP | f, | |
Cudd_HookType | where | |||
) | [inline] |
References checkedResult(), and getManager().
dd_type CCuddInterface::apply | ( | void_function | func | ) | const [inline, protected] |
Call function.
References checkedResult(), and getManager().
dd_type CCuddInterface::apply | ( | unary_int_function | func, | |
idx_type | idx | |||
) | const [inline, protected] |
Apply function to given index.
References checkedResult(), and getManager().
idx_type CCuddInterface::checkedResult | ( | idx_type | result | ) | const [inline, protected] |
Generate check numerical result of previous operation.
References checkReturnValue().
dd_type CCuddInterface::checkedResult | ( | node_type | result | ) | const [inline, protected] |
Generate check result of previous node operation and convert.
References checkReturnValue(), and getDiagram().
Referenced by AddHook(), apply(), CheckKeys(), DebugCheck(), DisableReorderingReporting(), EnableReorderingReporting(), info(), PrintLinear(), RemoveHook(), SharingSize(), zddOne(), zddReduceHeap(), and zddShuffleHeap().
void CCuddInterface::CheckKeys | ( | ) | [inline] |
References checkedResult(), and getManager().
void CCuddInterface::checkReturnValue | ( | const int | result | ) | const [inline] |
References getManager(), and UNLIKELY.
void CCuddInterface::checkReturnValue | ( | const node_type | result | ) | const [inline] |
Referenced by checkedResult().
void CCuddInterface::DebugCheck | ( | ) | [inline] |
References checkedResult(), and getManager().
void CCuddInterface::DisableReorderingReporting | ( | ) | [inline] |
References checkedResult(), and getManager().
void CCuddInterface::EnableReorderingReporting | ( | ) | [inline] |
References checkedResult(), and getManager().
dd_type CCuddInterface::getDiagram | ( | node_type | result | ) | const [inline, protected] |
errorfunc_type CCuddInterface::getHandler | ( | ) | const [inline] |
Extract function for error handling.
mgrcore_type CCuddInterface::getManager | ( | ) | const [inline] |
Get pure CUDD structure.
Referenced by AddHook(), apply(), CheckKeys(), checkReturnValue(), DebugCheck(), DisableReorderingReporting(), EnableReorderingReporting(), info(), IsInHook(), MakeZddTreeNode(), nVariables(), PrintLinear(), ReadInvPermZdd(), ReadLinear(), ReadPermZdd(), RemoveHook(), ReorderingStatusZdd(), zddOne(), zddPrintSubtable(), zddReduceHeap(), zddShuffleHeap(), and zddSymmProfile().
const_varname_reference CCuddInterface::getName | ( | idx_type | idx | ) | const [inline] |
Get name of variable with index idx.
Referenced by CDDManagerBase< CCuddInterface, CCuddInterface >::getVariableName().
dd_type CCuddInterface::getVar | ( | idx_type | idx | ) | const [inline] |
References getDiagram().
Referenced by CDDManagerBase< CCuddInterface, CCuddInterface >::persistentVariable().
void CCuddInterface::info | ( | ) | const [inline] |
Print statistical information.
References checkedResult(), and getManager().
Referenced by CDDManagerBase< CCuddInterface, CCuddInterface >::printInfo().
int CCuddInterface::IsInHook | ( | DD_HFP | f, | |
Cudd_HookType | where | |||
) | const [inline] |
References getManager().
bool CCuddInterface::isVerbose | ( | ) | const [inline] |
void CCuddInterface::makeTerse | ( | ) | [inline] |
void CCuddInterface::makeVerbose | ( | ) | [inline] |
MtrNode* CCuddInterface::MakeZddTreeNode | ( | size_type | low, | |
size_type | size, | |||
size_type | type | |||
) | [inline] |
References getManager().
mgrcore_ptr CCuddInterface::managerCore | ( | ) | const [inline] |
Get (shared) pointer to initialized manager.
Referenced by extract_manager(), get_mgr_core(), and getDiagram().
size_type CCuddInterface::nVariables | ( | ) | const [inline] |
Get number of managed variables.
References getManager().
Referenced by CDDManagerBase< CCuddInterface, CCuddInterface >::nVariables().
size_type CCuddInterface::Prime | ( | size_type | pr | ) | const [inline] |
void CCuddInterface::PrintLinear | ( | ) | [inline] |
References checkedResult(), and getManager().
void CCuddInterface::PrintVersion | ( | FILE * | fp | ) | const [inline] |
idx_type CCuddInterface::ReadInvPermZdd | ( | idx_type | i | ) | const [inline] |
References getManager().
int CCuddInterface::ReadLinear | ( | int | x, | |
int | y | |||
) | [inline] |
References getManager().
idx_type CCuddInterface::ReadPermZdd | ( | idx_type | i | ) | const [inline] |
References getManager().
void CCuddInterface::RemoveHook | ( | DD_HFP | f, | |
Cudd_HookType | where | |||
) | [inline] |
References checkedResult(), and getManager().
int CCuddInterface::ReorderingStatusZdd | ( | Cudd_ReorderingType * | method | ) | const [inline] |
References getManager().
errorfunc_type CCuddInterface::setHandler | ( | errorfunc_type | newHandler | ) | [inline] |
Define function for error handling.
* void CCuddInterface::setName | ( | idx_type | idx, | |
const_varname_reference | varname | |||
) | [inline] |
Set name of variable with index idx.
BOOST_PP_SEQ_FOR_EACH(PB_CUDDMGR_SET, size_type, (SetMinHit)(SetLooseUpTo)(SetMaxCacheHard)(SetMaxLive) ) BOOST_PP_SEQ_FOR_EACH(PB_CUDDMGR_SET, int, (SetSiftMaxVar)(SetSiftMaxSwap)(SetRecomb)(SetSymmviolation) (SetArcviolation)(SetPopulationSize)(SetNumberXovers) ) BOOST_PP_SEQ_FOR_EACH(PB_CUDDMGR_SET, FILE*, (SetStdout)(SetStderr)) BOOST_PP_SEQ_FOR_EACH(PB_CUDDMGR_SWITCH, BOOST_PP_NIL, (zddRealignEnable)(zddRealignDisable) (AutodynDisableZdd)(FreeZddTree) (EnableGarbageCollection)(DisableGarbageCollection) (TurnOnCountDead)(TurnOffCountDead)(ClearErrorCode) ) BOOST_PP_SEQ_FOR_EACH(PB_CUDDMGR_READ, double, (ReadCacheUsedSlots)(ReadCacheLookUps)(ReadCacheHits) (ReadSwapSteps)(ReadMaxGrowth)(AverageDistance) ) BOOST_PP_SEQ_FOR_EACH(PB_CUDDMGR_READ, size_type, (ReadCacheSlots)(ReadMinHit)(ReadLooseUpTo)(ReadMaxCache) (ReadMaxCacheHard)(ReadSlots)(ReadKeys)(ReadDead)(ReadMinDead) (ReadNextReordering)(ReadMaxLive) ) BOOST_PP_SEQ_FOR_EACH(PB_CUDDMGR_READ, int, (zddRealignmentEnabled)(ReadZddSize)(ReadReorderings)(ReadSiftMaxVar) (ReadSiftMaxSwap)(ReadGarbageCollections)(GarbageCollectionEnabled) (DeadAreCounted)(ReadRecomb) (ReadPopulationSize)(ReadSymmviolation)(ReadArcviolation) (ReadNumberXovers)(ReorderingReporting)(ReadErrorCode) ) BOOST_PP_SEQ_FOR_EACH(PB_CUDDMGR_READ, long, (ReadReorderingTime)(ReadGarbageCollectionTime) (ReadPeakNodeCount)(zddReadNodeCount) ) BOOST_PP_SEQ_FOR_EACH(PB_CUDDMGR_READ, large_size_type, (ReadMemoryInUse)(ReadMaxMemory) ) BOOST_PP_SEQ_FOR_EACH(PB_CUDDMGR_READ, FILE*, (ReadStdout)(ReadStderr)) void AutodynEnableZdd ( Cudd_ReorderingType arg) { BOOST_PP_CAT(Cudd_, AutodynEnableZdd )(getManager(), arg); } void SetMaxMemory ( unsigned long arg) { BOOST_PP_CAT(Cudd_, SetMaxMemory )(getManager(), arg); } void SetMaxGrowth ( double arg) { BOOST_PP_CAT(Cudd_, SetMaxGrowth )(getManager(), arg); } void SetZddTree ( MtrNode* arg) { BOOST_PP_CAT(Cudd_, SetZddTree )(getManager(), arg); }
Referenced by CDDManagerBase< CCuddInterface, CCuddInterface >::setVariableName().
int CCuddInterface::SharingSize | ( | dd_type * | nodes, | |
int | nlen | |||
) | const [inline] |
References checkedResult().
CCuddZDD CCuddInterface::zddOne | ( | ) | const [inline] |
Get 1-terminal for ZDDs.
References checkedResult(), and getManager().
CCuddZDD CCuddInterface::zddOne | ( | idx_type | iMax | ) | const [inline] |
Get 1-terminal for ZDDs.
References apply().
Referenced by CDDManagerBase< CCuddInterface, CCuddInterface >::blank().
void CCuddInterface::zddPrintSubtable | ( | ) | const [inline] |
References getManager().
void CCuddInterface::zddReduceHeap | ( | Cudd_ReorderingType | heuristic, | |
int | minsize | |||
) | [inline] |
References checkedResult(), and getManager().
void CCuddInterface::zddShuffleHeap | ( | int * | permutation | ) | [inline] |
References checkedResult(), and getManager().
void CCuddInterface::zddSymmProfile | ( | int | lower, | |
int | upper | |||
) | const [inline] |
References getManager().
CCuddZDD CCuddInterface::zddVar | ( | idx_type | idx | ) | const [inline] |
Get ZDD variable.
References apply().
Referenced by CDDManagerBase< CCuddInterface, CCuddInterface >::ddVariable().
CCuddZDD CCuddInterface::zddZero | ( | ) | const [inline] |
Get 0-terminal for ZDDs.
References apply().
Referenced by CDDManagerBase< CCuddInterface, CCuddInterface >::empty().