<tr><tdclass="mdescLeft"> </td><tdclass="mdescRight">Empty constructor - just do nothing, used for declaring an object and initialize it later. <br/></td></tr>
<tr><tdclass="memItemLeft"align="right"valign="top"> </td><tdclass="memItemRight"valign="bottom"><aclass="el"href="classCSP.html#ad49548121582cc2d59e0d7f100092b75">CSP</a> (int n, bool(*c)(std::vector<<aclass="el"href="structCSPvariable.html">CSPvariable</a>< T >>)=__default_constraint)</td></tr>
<tr><tdclass="memItemLeft"align="right"valign="top"> </td><tdclass="memItemRight"valign="bottom"><aclass="el"href="classCSP.html#a734bb08d8f45394a2acfc8822981a6d0">CSP</a> (int n, T default_value, bool set_variables=false, bool(*c)(std::vector<<aclass="el"href="structCSPvariable.html">CSPvariable</a>< T >>)=__default_constraint)</td></tr>
<tr><tdclass="memItemLeft"align="right"valign="top">void </td><tdclass="memItemRight"valign="bottom"><aclass="el"href="classCSP.html#a4017c17aac9d3e96d0e821ebbe09da7b">setDomain</a> (size_t index, std::vector< T > domain)</td></tr>
<tr><tdclass="mdescLeft"> </td><tdclass="mdescRight">Set the domain for the i-th variable. <ahref="#a4017c17aac9d3e96d0e821ebbe09da7b"></a><br/></td></tr>
<tr><tdclass="memItemLeft"align="right"valign="top">void </td><tdclass="memItemRight"valign="bottom"><aclass="el"href="classCSP.html#a65518e67e33e31bff1b5f9aabdf80a01">setDomain</a> (size_t index, T domain[], int size)</td></tr>
<tr><tdclass="mdescLeft"> </td><tdclass="mdescRight">Set the domain for the i-th variable. <ahref="#a65518e67e33e31bff1b5f9aabdf80a01"></a><br/></td></tr>
<tr><tdclass="memItemLeft"align="right"valign="top">void </td><tdclass="memItemRight"valign="bottom"><aclass="el"href="classCSP.html#a534a0d9bd10fb544f94196bf3c386657">setConstraint</a> (bool(*c)(std::vector<<aclass="el"href="structCSPvariable.html">CSPvariable</a>< T >>))</td></tr>
<tr><tdclass="mdescLeft"> </td><tdclass="mdescRight">Apply the constraint to the <aclass="el"href="classCSP.html"title="Main class for managing a CSP.">CSP</a> as a boolean function. <ahref="#a534a0d9bd10fb544f94196bf3c386657"></a><br/></td></tr>
<tr><tdclass="memItemLeft"align="right"valign="top">void </td><tdclass="memItemRight"valign="bottom"><aclass="el"href="classCSP.html#a457e1df05d4ec16be00118bda22fd882">setConstraint</a> (std::vector< bool(*)(std::vector<<aclass="el"href="structCSPvariable.html">CSPvariable</a>< T >>) > c)</td></tr>
<tr><tdclass="mdescLeft"> </td><tdclass="mdescRight">Apply the constraints to the <aclass="el"href="classCSP.html"title="Main class for managing a CSP.">CSP</a> as vector of boolean functions. <ahref="#a457e1df05d4ec16be00118bda22fd882"></a><br/></td></tr>
<tr><tdclass="mdescLeft"> </td><tdclass="mdescRight">Drops a constraint from the <aclass="el"href="classCSP.html"title="Main class for managing a CSP.">CSP</a>. <ahref="#a0231b93bceae257f0e1c35041f8fe63f"></a><br/></td></tr>
<tr><tdclass="memItemLeft"align="right"valign="top">void </td><tdclass="memItemRight"valign="bottom"><aclass="el"href="classCSP.html#a8dc6aec6ca7e40d198e58b0ec14fee66">appendConstraint</a> (bool(*c)(std::vector<<aclass="el"href="structCSPvariable.html">CSPvariable</a>< T >>))</td></tr>
<tr><tdclass="mdescLeft"> </td><tdclass="mdescRight">Append a constraint to the list of the constraint of the <aclass="el"href="classCSP.html"title="Main class for managing a CSP.">CSP</a>. <ahref="#a8dc6aec6ca7e40d198e58b0ec14fee66"></a><br/></td></tr>
<tr><tdclass="mdescLeft"> </td><tdclass="mdescRight">Updates the domains of the variables. Any constraint or node fixed value is applied. <ahref="#a466845256e638c5e258fd728b641359f"></a><br/></td></tr>
<tr><tdclass="mdescLeft"> </td><tdclass="mdescRight">Get, if it exists, the solution of the <aclass="el"href="classCSP.html"title="Main class for managing a CSP.">CSP</a>, calling refreshDomains until a fixed point is reached. <br/></td></tr>
<tr><tdclass="memItemLeft"align="right"valign="top">std::vector< T > </td><tdclass="memItemRight"valign="bottom"><aclass="el"href="classCSP.html#ae9db774b971c480cbef66168b9b6cf07">domain</a> (size_t index)</td></tr>
<tr><tdclass="mdescLeft"> </td><tdclass="mdescRight">Get the domain of the i-th variable. <ahref="#ae9db774b971c480cbef66168b9b6cf07"></a><br/></td></tr>
<tr><tdclass="mdescLeft"> </td><tdclass="mdescRight">Get the number of variables in the current <aclass="el"href="classCSP.html"title="Main class for managing a CSP.">CSP</a>. <ahref="#a125c7171c19b99e631926bbe011f127d"></a><br/></td></tr>
<tr><tdclass="memItemLeft"align="right"valign="top">void </td><tdclass="memItemRight"valign="bottom"><aclass="el"href="classCSP.html#ac25064c5b2d4e1020173b56913251ebd">setValue</a> (size_t index, T value)</td></tr>
<tr><tdclass="mdescLeft"> </td><tdclass="mdescRight">Set the value of a variable as a constraint. <ahref="#ac25064c5b2d4e1020173b56913251ebd"></a><br/></td></tr>
<tr><tdclass="mdescLeft"> </td><tdclass="mdescRight">Marks a variable as not set, and if a default value was assigned in the <aclass="el"href="classCSP.html"title="Main class for managing a CSP.">CSP</a> constructor, this value will be set. By default, unless specified in the constructor, all the variables are considered as not set. <ahref="#a4c0cae125a610f519dc22eaec255a0ae"></a><br/></td></tr>
<tr><tdclass="mdescLeft"> </td><tdclass="mdescRight">Check if the current <aclass="el"href="classCSP.html"title="Main class for managing a CSP.">CSP</a>, with the applied constraints, is satisfiable. <ahref="#a7ef9eb91c38815c9d82182696a6bd5d3"></a><br/></td></tr>
<tr><tdclass="mdescLeft"> </td><tdclass="mdescRight">Check if the <aclass="el"href="classCSP.html"title="Main class for managing a CSP.">CSP</a>, with the given variables, domains and constraints, admits a unique solution, i.e. each domain of each variable contains an only element. <ahref="#ae96286c6c7dfb6fe077544e0d4af15f4"></a><br/></td></tr>
<tr><tdclass="mdescLeft"> </td><tdclass="mdescRight">Check if any of the variables in the <aclass="el"href="classCSP.html"title="Main class for managing a CSP.">CSP</a> has a domain containing an only item. If so, it automatically assignes that item as value of the variable. <br/></td></tr>
<tr><tdclass="mdescLeft"> </td><tdclass="mdescRight">Check if the i-th variable in the <aclass="el"href="classCSP.html"title="Main class for managing a CSP.">CSP</a> has a fixed value. <ahref="#a213dafc1aae7b1825371810a511eca4f"></a><br/></td></tr>
<tr><tdclass="mdescLeft"> </td><tdclass="mdescRight">Get the value of the i-th variable of the <aclass="el"href="classCSP.html"title="Main class for managing a CSP.">CSP</a>. Be careful: before using this function you should check whether the variable you're going to check is actually set, using the <aclass="el"href="classCSP.html#a213dafc1aae7b1825371810a511eca4f"title="Check if the i-th variable in the CSP has a fixed value.">isSet()</a> method, unless you know what you're doing, in order to avoid reading inconsistent data. <ahref="#aafa5e1a65d6c5d80780437d8d684f32a"></a><br/></td></tr>
<tr><tdvalign="top"></td><tdvalign="top"><em>n</em> </td><td>Number of variables in the <aclass="el"href="classCSP.html"title="Main class for managing a CSP.">CSP</a></td></tr>
<tr><tdvalign="top"></td><tdvalign="top"><em>c</em> </td><td>Boolean function representing the constraint of the <aclass="el"href="classCSP.html"title="Main class for managing a CSP.">CSP</a> If no constraint function is set in the constructor or using the applyConstraint() method, a default function always returning true will be used, that allows any domain for any variable to be valid (no constraint) </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<aclass="anchor"id="a734bb08d8f45394a2acfc8822981a6d0"></a><!-- doxytag: member="CSP::CSP" ref="a734bb08d8f45394a2acfc8822981a6d0" args="(int n, T default_value, bool set_variables=false, bool(*c)(std::vector< CSPvariable< T > >)=__default_constraint)" -->
<divclass="memitem">
<divclass="memproto">
<divclass="memtemplate">
template<class T ></div>
<tableclass="memname">
<tr>
<tdclass="memname"><aclass="el"href="classCSP.html">CSP</a>< T >::<aclass="el"href="classCSP.html">CSP</a></td>
<tr><tdvalign="top"></td><tdvalign="top"><em>n</em> </td><td>Number of variables in the <aclass="el"href="classCSP.html"title="Main class for managing a CSP.">CSP</a></td></tr>
<tr><tdvalign="top"></td><tdvalign="top"><em>default_value</em> </td><td>Default value for the variables in the <aclass="el"href="classCSP.html"title="Main class for managing a CSP.">CSP</a> when initialized </td></tr>
<tr><tdvalign="top"></td><tdvalign="top"><em>set_variables</em> </td><td>Decide whether mark the variables set with default_value as "set" or "not set" (default: not set) </td></tr>
<tr><tdvalign="top"></td><tdvalign="top"><em>c</em> </td><td>Boolean function representing the constraint of the <aclass="el"href="classCSP.html"title="Main class for managing a CSP.">CSP</a> If no constraint function is set in the constructor or using the applyConstraint() method, a default function always returning true will be used, that allows any domain for any variable to be valid (no constraint) </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<aclass="anchor"id="a8dc6aec6ca7e40d198e58b0ec14fee66"></a><!-- doxytag: member="CSP::appendConstraint" ref="a8dc6aec6ca7e40d198e58b0ec14fee66" args="(bool(*c)(std::vector< CSPvariable< T > >))" -->
<divclass="memitem">
<divclass="memproto">
<divclass="memtemplate">
template<class T ></div>
<tableclass="memname">
<tr>
<tdclass="memname">void <aclass="el"href="classCSP.html">CSP</a>< T >::appendConstraint </td>
<td>(</td>
<tdclass="paramtype">bool(*)(std::vector<<aclass="el"href="structCSPvariable.html">CSPvariable</a>< T >>) </td>
<tdclass="paramname"><em>c</em></td>
<td> ) </td>
<td></td>
</tr>
</table>
</div>
<divclass="memdoc">
<p>Append a constraint to the list of the constraint of the <aclass="el"href="classCSP.html"title="Main class for managing a CSP.">CSP</a>. </p>
<dl><dt><b>Parameters:</b></dt><dd>
<tableborder="0"cellspacing="2"cellpadding="0">
<tr><tdvalign="top"></td><tdvalign="top"><em>c</em> </td><td>A function pointer returning a boolean value representing the new constraint </td></tr>
<p>Check if the <aclass="el"href="classCSP.html"title="Main class for managing a CSP.">CSP</a>, with the given variables, domains and constraints, admits a unique solution, i.e. each domain of each variable contains an only element. </p>
<dlclass="return"><dt><b>Returns:</b></dt><dd>true if the <aclass="el"href="classCSP.html"title="Main class for managing a CSP.">CSP</a> has an only possible solution, false otherwise </dd></dl>
<p>Check if the current <aclass="el"href="classCSP.html"title="Main class for managing a CSP.">CSP</a>, with the applied constraints, is satisfiable. </p>
<dlclass="return"><dt><b>Returns:</b></dt><dd>true if the <aclass="el"href="classCSP.html"title="Main class for managing a CSP.">CSP</a> has at least a possible solution, false otherwise </dd></dl>
<tr><tdvalign="top"></td><tdvalign="top"><em>max_iterations</em> </td><td>Maximum number of iterations, after which the function will quit. This can be used to break endless loops in domains assignations. </td></tr>
<tdclass="memname">void <aclass="el"href="classCSP.html">CSP</a>< T >::setConstraint </td>
<td>(</td>
<tdclass="paramtype">std::vector< bool(*)(std::vector<<aclass="el"href="structCSPvariable.html">CSPvariable</a>< T >>) > </td>
<tdclass="paramname"><em>c</em></td>
<td> ) </td>
<td><code> [inline]</code></td>
</tr>
</table>
</div>
<divclass="memdoc">
<p>Apply the constraints to the <aclass="el"href="classCSP.html"title="Main class for managing a CSP.">CSP</a> as vector of boolean functions. </p>
<dl><dt><b>Parameters:</b></dt><dd>
<tableborder="0"cellspacing="2"cellpadding="0">
<tr><tdvalign="top"></td><tdvalign="top"><em>c</em> </td><td>Vector containing pointers to boolean functions representing the constraints of the <aclass="el"href="classCSP.html"title="Main class for managing a CSP.">CSP</a></td></tr>
</table>
</dd>
</dl>
</div>
</div>
<aclass="anchor"id="a534a0d9bd10fb544f94196bf3c386657"></a><!-- doxytag: member="CSP::setConstraint" ref="a534a0d9bd10fb544f94196bf3c386657" args="(bool(*c)(std::vector< CSPvariable< T > >))" -->
<divclass="memitem">
<divclass="memproto">
<divclass="memtemplate">
template<class T ></div>
<tableclass="memname">
<tr>
<tdclass="memname">void <aclass="el"href="classCSP.html">CSP</a>< T >::setConstraint </td>
<td>(</td>
<tdclass="paramtype">bool(*)(std::vector<<aclass="el"href="structCSPvariable.html">CSPvariable</a>< T >>) </td>
<tdclass="paramname"><em>c</em></td>
<td> ) </td>
<td></td>
</tr>
</table>
</div>
<divclass="memdoc">
<p>Apply the constraint to the <aclass="el"href="classCSP.html"title="Main class for managing a CSP.">CSP</a> as a boolean function. </p>
<dl><dt><b>Parameters:</b></dt><dd>
<tableborder="0"cellspacing="2"cellpadding="0">
<tr><tdvalign="top"></td><tdvalign="top"><em>c</em> </td><td>Boolean function representing the constraint of the <aclass="el"href="classCSP.html"title="Main class for managing a CSP.">CSP</a></td></tr>
</table>
</dd>
</dl>
</div>
</div>
<aclass="anchor"id="a65518e67e33e31bff1b5f9aabdf80a01"></a><!-- doxytag: member="CSP::setDomain" ref="a65518e67e33e31bff1b5f9aabdf80a01" args="(size_t index, T domain[], int size)" -->
<divclass="memitem">
<divclass="memproto">
<divclass="memtemplate">
template<class T ></div>
<tableclass="memname">
<tr>
<tdclass="memname">void <aclass="el"href="classCSP.html">CSP</a>< T >::setDomain </td>
<tdclass="memname">void <aclass="el"href="classCSP.html">CSP</a>< T >::unsetValue </td>
<td>(</td>
<tdclass="paramtype">size_t </td>
<tdclass="paramname"><em>index</em></td>
<td> ) </td>
<td><code> [inline]</code></td>
</tr>
</table>
</div>
<divclass="memdoc">
<p>Marks a variable as not set, and if a default value was assigned in the <aclass="el"href="classCSP.html"title="Main class for managing a CSP.">CSP</a> constructor, this value will be set. By default, unless specified in the constructor, all the variables are considered as not set. </p>
<dl><dt><b>Parameters:</b></dt><dd>
<tableborder="0"cellspacing="2"cellpadding="0">
<tr><tdvalign="top"></td><tdvalign="top"><em>index</em> </td><td>Index of the variable to be unset </td></tr>
<tdclass="memname">T <aclass="el"href="classCSP.html">CSP</a>< T >::value </td>
<td>(</td>
<tdclass="paramtype">size_t </td>
<tdclass="paramname"><em>i</em></td>
<td> ) </td>
<td><code> [inline]</code></td>
</tr>
</table>
</div>
<divclass="memdoc">
<p>Get the value of the i-th variable of the <aclass="el"href="classCSP.html"title="Main class for managing a CSP.">CSP</a>. Be careful: before using this function you should check whether the variable you're going to check is actually set, using the <aclass="el"href="classCSP.html#a213dafc1aae7b1825371810a511eca4f"title="Check if the i-th variable in the CSP has a fixed value.">isSet()</a> method, unless you know what you're doing, in order to avoid reading inconsistent data. </p>
<dl><dt><b>Parameters:</b></dt><dd>
<tableborder="0"cellspacing="2"cellpadding="0">
<tr><tdvalign="top"></td><tdvalign="top"><em>i</em> </td><td>Index of the variable to get </td></tr>
</table>
</dd>
</dl>
<dlclass="return"><dt><b>Returns:</b></dt><dd>The value of the variable, if the variable exists </dd></dl>
</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>