<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> <title>PolyBoRi: CCuddCore.h Source File</title> <link href="tabs.css" rel="stylesheet" type="text/css"> <link href="doxygen.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.5.9 --> <div class="navigation" id="top"> <div class="tabs"> <ul> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="pages.html"><span>Related Pages</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li><a href="annotated.html"><span>Classes</span></a></li> <li class="current"><a href="files.html"><span>Files</span></a></li> </ul> </div> <div class="tabs"> <ul> <li><a href="files.html"><span>File List</span></a></li> <li><a href="globals.html"><span>File Members</span></a></li> </ul> </div> <h1>CCuddCore.h</h1><a href="CCuddCore_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">// -*- c++ -*-</span> <a name="l00002"></a>00002 <span class="comment">//*****************************************************************************</span> <a name="l00051"></a>00051 <span class="comment"></span><span class="comment">//*****************************************************************************</span> <a name="l00052"></a>00052 <a name="l00053"></a>00053 <span class="preprocessor">#ifndef CCuddCore_h</span> <a name="l00054"></a>00054 <span class="preprocessor"></span><span class="preprocessor">#define CCuddCore_h</span> <a name="l00055"></a>00055 <span class="preprocessor"></span> <a name="l00056"></a>00056 <span class="comment">// include basic definitions</span> <a name="l00057"></a>00057 <span class="preprocessor">#include "<a class="code" href="pbori__defs_8h.html">pbori_defs.h</a>"</span> <a name="l00058"></a>00058 <a name="l00059"></a>00059 <span class="comment">// intrisive (shared) pointer functionality</span> <a name="l00060"></a>00060 <span class="preprocessor">#include <boost/intrusive_ptr.hpp></span> <a name="l00061"></a>00061 <a name="l00062"></a>00062 <span class="comment">// get PolyBoRi routines and functionals</span> <a name="l00063"></a>00063 <span class="preprocessor">#include "<a class="code" href="pbori__func_8h.html">pbori_func.h</a>"</span> <a name="l00064"></a>00064 <span class="preprocessor">#include "<a class="code" href="pbori__traits_8h.html">pbori_traits.h</a>"</span> <a name="l00065"></a>00065 <a name="l00066"></a>00066 <span class="preprocessor">#include "<a class="code" href="CVariableNames_8h.html">CVariableNames.h</a>"</span> <a name="l00067"></a>00067 <a name="l00068"></a>00068 <span class="preprocessor">#include <vector></span> <a name="l00069"></a>00069 <span class="preprocessor">#include "cuddInt.h"</span> <a name="l00070"></a>00070 <a name="l00071"></a>00071 <a class="code" href="pbori__defs_8h.html#6ae360a591580558f31b6157ee792a10" title="Start project&#39;s namespace.">BEGIN_NAMESPACE_PBORI</a> <a name="l00072"></a>00072 <a name="l00084"></a><a class="code" href="classpolybori_1_1CCuddCore.html">00084</a> <span class="keyword">class </span><a class="code" href="classpolybori_1_1CCuddCore.html" title="This class prepares the CUDD&#39;s raw decision diagram manager structure for the...">CCuddCore</a> { <a name="l00085"></a>00085 <a name="l00086"></a>00086 <span class="keyword">public</span>: <a name="l00088"></a><a class="code" href="classpolybori_1_1CCuddCore.html#26360a33fa8a030b055db06f81f75f7f">00088</a> <a class="code" href="pbori__traits_8h.html#71c5e229a8a64d32fbf0a45acce725a4">PB_DECLARE_CUDD_TYPES</a>(<a class="code" href="structpolybori_1_1mgrcore__traits_3_01Cudd_01_4.html">mgrcore_traits<Cudd></a>) <a name="l00089"></a>00089 <a name="l00090"></a>00090 <a name="l00091"></a><a class="code" href="classpolybori_1_1CCuddCore.html#3f602e8ee24382452897eec445aaa8be">00091</a> typedef <a class="code" href="classpolybori_1_1CCuddCore.html" title="This class prepares the CUDD&#39;s raw decision diagram manager structure for the...">CCuddCore</a> <a class="code" href="classpolybori_1_1CCuddCore.html" title="This class prepares the CUDD&#39;s raw decision diagram manager structure for the...">self</a>; <a name="l00092"></a>00092 <a name="l00094"></a><a class="code" href="classpolybori_1_1CCuddCore.html#e019decfc7c24d36400cf8bf9c5f8f60">00094</a> typedef boost::intrusive_ptr<self> mgrcore_ptr; <a name="l00095"></a>00095 <a name="l00097"></a><a class="code" href="classpolybori_1_1CCuddCore.html#b481b743d7413ed9acfa1a6f98339025">00097</a> typedef <a class="code" href="classpolybori_1_1CVariableNames.html">CVariableNames</a> <a class="code" href="classpolybori_1_1CVariableNames.html">variable_names_type</a>; <a name="l00098"></a>00098 <a name="l00100"></a><a class="code" href="classpolybori_1_1CCuddCore.html#cad3c6d27f6a9a9b720810e54f2b262f">00100</a> typedef variable_names_type::const_reference const_varname_reference; <a name="l00101"></a>00101 <a name="l00103"></a><a class="code" href="classpolybori_1_1CCuddCore.html#7ef736a89183d7e6bd926f60de97f8dd">00103</a> mgrcore_type manager; <a name="l00104"></a>00104 <a name="l00106"></a><a class="code" href="classpolybori_1_1CCuddCore.html#5fb2f63e4a9598c00ffcf0b339810d73">00106</a> static errorfunc_type errorHandler; <a name="l00107"></a>00107 <a name="l00109"></a><a class="code" href="classpolybori_1_1CCuddCore.html#9e092b03039e4c687f81097b07ab05f0">00109</a> static <span class="keywordtype">bool</span> verbose; <a name="l00110"></a>00110 <a name="l00112"></a><a class="code" href="classpolybori_1_1CCuddCore.html#46334721a02ee80a7d1f9faf33482974">00112</a> refcount_type ref; <a name="l00113"></a>00113 <a name="l00115"></a><a class="code" href="classpolybori_1_1CCuddCore.html#18b22c182e61079830a3a6aa97e076b7">00115</a> variable_names_type m_names; <a name="l00116"></a>00116 <a name="l00117"></a><a class="code" href="classpolybori_1_1CCuddCore.html#9f6991e1d6c73dfd2543ada02a8f6d89">00117</a> std::vector<node_type> m_vars; <a name="l00118"></a>00118 <a name="l00119"></a>00119 <a name="l00121"></a><a class="code" href="classpolybori_1_1CCuddCore.html#dda0b4a13cb75e82f8caffebce4049e8">00121</a> <a class="code" href="classpolybori_1_1CCuddCore.html" title="This class prepares the CUDD&#39;s raw decision diagram manager structure for the...">CCuddCore</a>(size_type numVars = 0, <a name="l00122"></a>00122 size_type numVarsZ = 0, <a name="l00123"></a>00123 size_type numSlots = CUDD_UNIQUE_SLOTS, <a name="l00124"></a>00124 size_type cacheSize = CUDD_CACHE_SLOTS, <a name="l00125"></a>00125 large_size_type maxMemory = 0): <a name="l00126"></a>00126 ref(0), m_names(numVarsZ), m_vars(numVarsZ) { <a name="l00127"></a>00127 manager = Cudd_Init(numVars,numVarsZ,numSlots,cacheSize,maxMemory); <a name="l00128"></a>00128 <a name="l00129"></a>00129 <a name="l00130"></a>00130 <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> idx = 0 ; idx < numVarsZ; ++idx) { <a name="l00131"></a>00131 m_vars[idx] = cuddUniqueInterZdd(manager, idx, DD_ONE(manager), <a name="l00132"></a>00132 DD_ZERO(manager)); <a name="l00133"></a>00133 Cudd_Ref(m_vars[idx]); <a name="l00134"></a>00134 } <a name="l00135"></a>00135 <a name="l00136"></a>00136 } <a name="l00137"></a>00137 <a name="l00139"></a><a class="code" href="classpolybori_1_1CCuddCore.html#ebc4c396c2598a7b130ca857199b323c">00139</a> <a class="code" href="classpolybori_1_1CCuddCore.html#ebc4c396c2598a7b130ca857199b323c" title="Destructor.">~CCuddCore</a>(){ <a name="l00140"></a>00140 <a name="l00141"></a>00141 <span class="keywordflow">for</span> (std::vector<node_type>::iterator iter = m_vars.begin(); iter != <a name="l00142"></a>00142 m_vars.end(); ++iter) { <a name="l00143"></a>00143 <a name="l00144"></a>00144 Cudd_RecursiveDerefZdd(manager, *iter); <a name="l00145"></a>00145 } <a name="l00146"></a>00146 <a name="l00147"></a>00147 <span class="keywordtype">int</span> retval = Cudd_CheckZeroRef(manager); <a name="l00148"></a>00148 <span class="comment">// Check for unexpected non-zero reference counts</span> <a name="l00149"></a>00149 assert(retval == 0); <a name="l00150"></a>00150 <a name="l00151"></a>00151 Cudd_Quit(manager); <a name="l00152"></a>00152 } <a name="l00153"></a>00153 <a name="l00155"></a><a class="code" href="classpolybori_1_1CCuddCore.html#4acf905d615867263eb2f439335be607">00155</a> <span class="keywordtype">void</span> <a class="code" href="classpolybori_1_1CCuddCore.html#4acf905d615867263eb2f439335be607" title="Increment reference count.">addRef</a>(){ ++ref; } <a name="l00156"></a>00156 <a name="l00158"></a><a class="code" href="classpolybori_1_1CCuddCore.html#8f314fd0e62db211609f0ad441d18e98">00158</a> refcount_type <a class="code" href="classpolybori_1_1CCuddCore.html#8f314fd0e62db211609f0ad441d18e98" title="Release this by decrementing reference counting.">release</a>() { <a name="l00159"></a>00159 <span class="keywordflow">return</span> (--ref); <a name="l00160"></a>00160 } <a name="l00161"></a>00161 }; <a name="l00162"></a>00162 <a name="l00164"></a>00164 <a name="l00165"></a>00165 <a name="l00166"></a>00166 <span class="keyword">inline</span> <span class="keywordtype">void</span> <a name="l00167"></a><a class="code" href="namespacepolybori.html#2b6ce8d579224b9c06c780a83cdc7b65">00167</a> <a class="code" href="namespacepolybori.html#2b6ce8d579224b9c06c780a83cdc7b65" title="Increment reference count.">intrusive_ptr_add_ref</a>(<a class="code" href="classpolybori_1_1CCuddCore.html" title="This class prepares the CUDD&#39;s raw decision diagram manager structure for the...">CCuddCore</a>* pCore){ <a name="l00168"></a>00168 pCore-><a class="code" href="classpolybori_1_1CCuddCore.html#4acf905d615867263eb2f439335be607" title="Increment reference count.">addRef</a>(); <a name="l00169"></a>00169 } <a name="l00170"></a>00170 <a name="l00172"></a>00172 <span class="keyword">inline</span> <span class="keywordtype">void</span> <a name="l00173"></a><a class="code" href="namespacepolybori.html#bdb490dae1745f4b59da20a56df00b69">00173</a> <a class="code" href="namespacepolybori.html#bdb490dae1745f4b59da20a56df00b69" title="Release current pointer by decrementing reference counting.">intrusive_ptr_release</a>(<a class="code" href="classpolybori_1_1CCuddCore.html" title="This class prepares the CUDD&#39;s raw decision diagram manager structure for the...">CCuddCore</a>* pCore) { <a name="l00174"></a>00174 <span class="keywordflow">if</span> (!(pCore-><a class="code" href="classpolybori_1_1CCuddCore.html#8f314fd0e62db211609f0ad441d18e98" title="Release this by decrementing reference counting.">release</a>())) { <a name="l00175"></a>00175 <span class="keyword">delete</span> pCore; <a name="l00176"></a>00176 } <a name="l00177"></a>00177 } <a name="l00179"></a>00179 <a name="l00180"></a>00180 <a class="code" href="pbori__defs_8h.html#faf094fde6c1a7f1aad18bcb455f3b06" title="Finish project&#39;s namespace.">END_NAMESPACE_PBORI</a> <a name="l00181"></a>00181 <a name="l00182"></a>00182 <span class="preprocessor">#endif</span> <a name="l00183"></a>00183 <span class="preprocessor"></span> <a name="l00184"></a>00184 </pre></div></div> <hr size="1"><address style="text-align: right;"><small>Generated on Wed Sep 9 14:30:54 2009 for PolyBoRi by <a href="http://www.doxygen.org/index.html"> <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.9 </small></address> </body> </html>