<aname="l00025"></a>00025 <spanclass="preprocessor"></span><spanclass="preprocessor">#error "csp++-def.h must not be included directly - include csp++.h instead"</span>
<aname="l00038"></a><aclass="code"href="structCSPvariable.html">00038</a><spanclass="keyword">struct </span><aclass="code"href="structCSPvariable.html"title="Struct used for describing a variable in the CSP.">CSPvariable</a> {
<aname="l00040"></a><aclass="code"href="structCSPvariable.html#a1fb7622b0576133aa9a2445da22fddac">00040</a><spanclass="keywordtype">int</span><aclass="code"href="structCSPvariable.html#a1fb7622b0576133aa9a2445da22fddac"title="Index of the variable.">index</a>;
<aname="l00043"></a><aclass="code"href="structCSPvariable.html#a8e7a1cbd9af27e295508794f871dc599">00043</a><spanclass="keywordtype">bool</span><aclass="code"href="structCSPvariable.html#a8e7a1cbd9af27e295508794f871dc599"title="If the value of the variable is set explicitely, this value is true.">fixed</a>;
<aname="l00046"></a><aclass="code"href="structCSPvariable.html#acc2ff31b449351f04b1c3a2a096e584c">00046</a> T <aclass="code"href="structCSPvariable.html#acc2ff31b449351f04b1c3a2a096e584c"title="The value of the variable.">value</a>;
<aname="l00047"></a>00047
<aname="l00049"></a><aclass="code"href="structCSPvariable.html#a66cf86ebf0fbbf8e571d7b585c9528a2">00049</a> std::vector<T><aclass="code"href="structCSPvariable.html#a66cf86ebf0fbbf8e571d7b585c9528a2"title="Domain of the variable, declared as a vector.">domain</a>;
<aname="l00050"></a>00050 };
<aname="l00051"></a>00051
<aname="l00056"></a><aclass="code"href="classCSPexception.html">00056</a><spanclass="keyword">class </span><aclass="code"href="classCSPexception.html"title="Class for managing exception in CSP.">CSPexception</a> : <spanclass="keyword">public</span> std::exception {
<aname="l00071"></a><aclass="code"href="classCSPexception.html#a7013e90a6c26ba4c15bc6fbc42be02ef">00071</a><spanclass="keyword">virtual</span><spanclass="keyword">const</span><spanclass="keywordtype">char</span>* <aclass="code"href="classCSPexception.html#a7013e90a6c26ba4c15bc6fbc42be02ef"title="Return the description of the exception.">what</a>() {
<aname="l00081"></a><aclass="code"href="classCSP.html">00081</a><spanclass="keyword">class </span><aclass="code"href="classCSP.html"title="Main class for managing a CSP.">CSP</a> {
<aname="l00086"></a>00086 TT <aclass="code"href="classCSP.html#aafa5e1a65d6c5d80780437d8d684f32a"title="Get the value of the i-th variable of the CSP. Be careful: before using this function...">value</a>[2];
<aname="l00096"></a>00096 <spanclass="keyword">static</span><spanclass="keywordtype">bool</span> __default_constraint ( std::vector<<aclass="code"href="structCSPvariable.html"title="Struct used for describing a variable in the CSP.">CSPvariable<T></a>> v ) { <spanclass="keywordflow">return</span><spanclass="keyword">true</span>; }
<aname="l00097"></a>00097 <spanclass="keywordtype">void</span> __init ( <spanclass="keywordtype">int</span> n, <spanclass="keywordtype">bool</span> (*c)(std::vector<<aclass="code"href="structCSPvariable.html"title="Struct used for describing a variable in the CSP.">CSPvariable<T></a>>) );
<aname="l00105"></a><aclass="code"href="classCSP.html#a3a4c1cfab4f5c2376b5f9da588e73f5a">00105</a><aclass="code"href="classCSP.html#a3a4c1cfab4f5c2376b5f9da588e73f5a"title="Empty constructor - just do nothing, used for declaring an object and initialize...">CSP</a>() {}
<aname="l00106"></a>00106
<aname="l00116"></a>00116 <aclass="code"href="classCSP.html#a3a4c1cfab4f5c2376b5f9da588e73f5a"title="Empty constructor - just do nothing, used for declaring an object and initialize...">CSP</a> ( <spanclass="keywordtype">int</span> n, <spanclass="keywordtype">bool</span> (*c)(std::vector<<aclass="code"href="structCSPvariable.html"title="Struct used for describing a variable in the CSP.">CSPvariable<T></a>>) = __default_constraint );
<aname="l00117"></a>00117
<aname="l00131"></a>00131 <aclass="code"href="classCSP.html#a3a4c1cfab4f5c2376b5f9da588e73f5a"title="Empty constructor - just do nothing, used for declaring an object and initialize...">CSP</a> ( <spanclass="keywordtype">int</span> n, T default_value, <spanclass="keywordtype">bool</span> set_variables = <spanclass="keyword">false</span>, <spanclass="keywordtype">bool</span> (*c)(std::vector<<aclass="code"href="structCSPvariable.html"title="Struct used for describing a variable in the CSP.">CSPvariable<T></a>>) = __default_constraint );
<aname="l00132"></a>00132
<aname="l00138"></a>00138 <spanclass="keywordtype">void</span><aclass="code"href="classCSP.html#a4017c17aac9d3e96d0e821ebbe09da7b"title="Set the domain for the i-th variable.">setDomain</a> ( <spanclass="keywordtype">size_t</span> index, std::vector<T><aclass="code"href="classCSP.html#ae9db774b971c480cbef66168b9b6cf07"title="Get the domain of the i-th variable.">domain</a> );
<aname="l00139"></a>00139
<aname="l00146"></a>00146 <spanclass="keywordtype">void</span><aclass="code"href="classCSP.html#a4017c17aac9d3e96d0e821ebbe09da7b"title="Set the domain for the i-th variable.">setDomain</a> ( <spanclass="keywordtype">size_t</span> index, T <aclass="code"href="classCSP.html#ae9db774b971c480cbef66168b9b6cf07"title="Get the domain of the i-th variable.">domain</a>[], <spanclass="keywordtype">int</span><aclass="code"href="classCSP.html#a125c7171c19b99e631926bbe011f127d"title="Get the number of variables in the current CSP.">size</a> );
<aname="l00147"></a>00147
<aname="l00152"></a>00152 <spanclass="keywordtype">void</span><aclass="code"href="classCSP.html#a534a0d9bd10fb544f94196bf3c386657"title="Apply the constraint to the CSP as a boolean function.">setConstraint</a> ( <spanclass="keywordtype">bool</span> (*c)(std::vector<<aclass="code"href="structCSPvariable.html"title="Struct used for describing a variable in the CSP.">CSPvariable<T></a>>) );
<aname="l00153"></a>00153
<aname="l00159"></a>00159 <spanclass="keywordtype">void</span><aclass="code"href="classCSP.html#a534a0d9bd10fb544f94196bf3c386657"title="Apply the constraint to the CSP as a boolean function.">setConstraint</a> ( std::vector<<spanclass="keywordtype">bool</span>(*)(std::vector<<aclass="code"href="structCSPvariable.html"title="Struct used for describing a variable in the CSP.">CSPvariable<T></a>>) > c );
<aname="l00160"></a>00160
<aname="l00165"></a>00165 <spanclass="keywordtype">void</span><aclass="code"href="classCSP.html#a0231b93bceae257f0e1c35041f8fe63f"title="Drops a constraint from the CSP.">dropConstraint</a> ( <spanclass="keywordtype">size_t</span> index );
<aname="l00166"></a>00166
<aname="l00171"></a>00171 <spanclass="keywordtype">void</span><aclass="code"href="classCSP.html#a8dc6aec6ca7e40d198e58b0ec14fee66"title="Append a constraint to the list of the constraint of the CSP.">appendConstraint</a> ( <spanclass="keywordtype">bool</span> (*c)(std::vector<<aclass="code"href="structCSPvariable.html"title="Struct used for describing a variable in the CSP.">CSPvariable<T></a>>) );
<aname="l00172"></a>00172
<aname="l00178"></a>00178 <spanclass="keywordtype">void</span><aclass="code"href="classCSP.html#a466845256e638c5e258fd728b641359f"title="Updates the domains of the variables. Any constraint or node fixed value is applied...">refreshDomains</a> ( <spanclass="keywordtype">void</span> );
<aname="l00179"></a>00179
<aname="l00184"></a>00184 <spanclass="keywordtype">void</span><aclass="code"href="classCSP.html#a7ff61c379081881c21626926bdfd8733"title="Get, if it exists, the solution of the CSP, calling refreshDomains until a fixed...">solve</a> ( <spanclass="keywordtype">size_t</span> maxIterations = 0 );
<aname="l00185"></a>00185
<aname="l00191"></a>00191 std::vector<T><aclass="code"href="classCSP.html#ae9db774b971c480cbef66168b9b6cf07"title="Get the domain of the i-th variable.">domain</a> ( <spanclass="keywordtype">size_t</span> index );
<aname="l00192"></a>00192
<aname="l00197"></a>00197 <spanclass="keywordtype">size_t</span><aclass="code"href="classCSP.html#a125c7171c19b99e631926bbe011f127d"title="Get the number of variables in the current CSP.">size</a> ( <spanclass="keywordtype">void</span> );
<aname="l00198"></a>00198
<aname="l00204"></a>00204 <spanclass="keywordtype">void</span><aclass="code"href="classCSP.html#ac25064c5b2d4e1020173b56913251ebd"title="Set the value of a variable as a constraint.">setValue</a> ( <spanclass="keywordtype">size_t</span> index, T <aclass="code"href="classCSP.html#aafa5e1a65d6c5d80780437d8d684f32a"title="Get the value of the i-th variable of the CSP. Be careful: before using this function...">value</a> );
<aname="l00205"></a>00205
<aname="l00213"></a>00213 <spanclass="keywordtype">void</span><aclass="code"href="classCSP.html#a4c0cae125a610f519dc22eaec255a0ae"title="Marks a variable as not set, and if a default value was assigned in the CSP constructor...">unsetValue</a> ( <spanclass="keywordtype">size_t</span> index );
<aname="l00214"></a>00214
<aname="l00219"></a>00219 <spanclass="keywordtype">bool</span><aclass="code"href="classCSP.html#a7ef9eb91c38815c9d82182696a6bd5d3"title="Check if the current CSP, with the applied constraints, is satisfiable.">isSatisfiable</a> ( <spanclass="keywordtype">void</span> );
<aname="l00220"></a>00220
<aname="l00227"></a>00227 <spanclass="keywordtype">bool</span><aclass="code"href="classCSP.html#ae96286c6c7dfb6fe077544e0d4af15f4"title="Check if the CSP, with the given variables, domains and constraints, admits a unique...">hasUniqueSolution</a> ( <spanclass="keywordtype">void</span> );
<aname="l00228"></a>00228
<aname="l00234"></a>00234 <spanclass="keywordtype">void</span><aclass="code"href="classCSP.html#ac74cb751589a58bf6f2815f6878d2213"title="Check if any of the variables in the CSP has a domain containing an only item. If...">assignUniqueDomains</a> ( <spanclass="keywordtype">void</span> );
<aname="l00240"></a>00240 <spanclass="keywordtype">bool</span><aclass="code"href="classCSP.html#a213dafc1aae7b1825371810a511eca4f"title="Check if the i-th variable in the CSP has a fixed value.">isSet</a> ( <spanclass="keywordtype">size_t</span> i );
<aname="l00241"></a>00241
<aname="l00251"></a>00251 T <aclass="code"href="classCSP.html#aafa5e1a65d6c5d80780437d8d684f32a"title="Get the value of the i-th variable of the CSP. Be careful: before using this function...">value</a> ( <spanclass="keywordtype">size_t</span> i );