\begin{DoxyCompactList}\small\item\em Empty constructor -\/ just do nothing, used for declaring an object and initialize it later. \item\end{DoxyCompactList}\item
\hyperlink{classCSP_ad49548121582cc2d59e0d7f100092b75}{CSP} (int n, bool($\ast$c)(std::vector$<$\hyperlink{structCSPvariable}{CSPvariable}$<$ T $>$$>$)=\_\-\_\-default\_\-constraint)
\begin{DoxyCompactList}\small\item\em Class constructor. \item\end{DoxyCompactList}\item
\hyperlink{classCSP_a734bb08d8f45394a2acfc8822981a6d0}{CSP} (int n, T default\_\-value, bool set\_\-variables=false, bool($\ast$c)(std::vector$<$\hyperlink{structCSPvariable}{CSPvariable}$<$ T $>$$>$)=\_\-\_\-default\_\-constraint)
\begin{DoxyCompactList}\small\item\em Class constructor. \item\end{DoxyCompactList}\item
void \hyperlink{classCSP_a4017c17aac9d3e96d0e821ebbe09da7b}{setDomain} (size\_\-t index, std::vector$<$ T $>$ domain)
\begin{DoxyCompactList}\small\item\em Set the domain for the i-\/th variable. \item\end{DoxyCompactList}\item
void \hyperlink{classCSP_a65518e67e33e31bff1b5f9aabdf80a01}{setDomain} (size\_\-t index, T domain\mbox{[}$\,$\mbox{]}, int size)
\begin{DoxyCompactList}\small\item\em Set the domain for the i-\/th variable. \item\end{DoxyCompactList}\item
void \hyperlink{classCSP_a534a0d9bd10fb544f94196bf3c386657}{setConstraint} (bool($\ast$c)(std::vector$<$\hyperlink{structCSPvariable}{CSPvariable}$<$ T $>$$>$))
\begin{DoxyCompactList}\small\item\em Apply the constraint to the \hyperlink{classCSP}{CSP} as a boolean function. \item\end{DoxyCompactList}\item
void \hyperlink{classCSP_a457e1df05d4ec16be00118bda22fd882}{setConstraint} (std::vector$<$ bool($\ast$)(std::vector$<$\hyperlink{structCSPvariable}{CSPvariable}$<$ T $>$$>$) $>$ c)
\begin{DoxyCompactList}\small\item\em Apply the constraints to the \hyperlink{classCSP}{CSP} as vector of boolean functions. \item\end{DoxyCompactList}\item
\begin{DoxyCompactList}\small\item\em Drops a constraint from the \hyperlink{classCSP}{CSP}. \item\end{DoxyCompactList}\item
void \hyperlink{classCSP_a8dc6aec6ca7e40d198e58b0ec14fee66}{appendConstraint} (bool($\ast$c)(std::vector$<$\hyperlink{structCSPvariable}{CSPvariable}$<$ T $>$$>$))
\begin{DoxyCompactList}\small\item\em Append a constraint to the list of the constraint of the \hyperlink{classCSP}{CSP}. \item\end{DoxyCompactList}\item
\begin{DoxyCompactList}\small\item\em Updates the domains of the variables. Any constraint or node fixed value is applied. \item\end{DoxyCompactList}\item
\begin{DoxyCompactList}\small\item\em Get, if it exists, the solution of the \hyperlink{classCSP}{CSP}, calling refreshDomains until a fixed point is reached. \item\end{DoxyCompactList}\item
std::vector$<$ T $>$\hyperlink{classCSP_ae9db774b971c480cbef66168b9b6cf07}{domain} (size\_\-t index)
\begin{DoxyCompactList}\small\item\em Marks a variable as not set, and if a default value was assigned in the \hyperlink{classCSP}{CSP} constructor, this value will be set. By default, unless specified in the constructor, all the variables are considered as not set. \item\end{DoxyCompactList}\item
\begin{DoxyCompactList}\small\item\em Check if the current \hyperlink{classCSP}{CSP}, with the applied constraints, is satisfiable. \item\end{DoxyCompactList}\item
\begin{DoxyCompactList}\small\item\em Check if the \hyperlink{classCSP}{CSP}, with the given variables, domains and constraints, admits a unique solution, i.e. each domain of each variable contains an only element. \item\end{DoxyCompactList}\item
\begin{DoxyCompactList}\small\item\em Check if any of the variables in the \hyperlink{classCSP}{CSP} has a domain containing an only item. If so, it automatically assignes that item as value of the variable. \item\end{DoxyCompactList}\item
\begin{DoxyCompactList}\small\item\em Check if the i-\/th variable in the \hyperlink{classCSP}{CSP} has a fixed value. \item\end{DoxyCompactList}\item
T \hyperlink{classCSP_aafa5e1a65d6c5d80780437d8d684f32a}{value} (size\_\-t i)
\begin{DoxyCompactList}\small\item\em Get the value of the i-\/th variable of the \hyperlink{classCSP}{CSP}. Be careful: before using this function you should check whether the variable you're going to check is actually set, using the \hyperlink{classCSP_a213dafc1aae7b1825371810a511eca4f}{isSet()} method, unless you know what you're doing, in order to avoid reading inconsistent data. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection{Detailed Description}
\subsubsection*{template$<$class T$>$ class CSP$<$ T $>$}
Main class for managing a \hyperlink{classCSP}{CSP}.
\item[{\em n}]Number of variables in the \hyperlink{classCSP}{CSP}\item[{\em c}]Boolean function representing the constraint of the \hyperlink{classCSP}{CSP} 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) \end{DoxyParams}
\item[{\em n}]Number of variables in the \hyperlink{classCSP}{CSP}\item[{\em default\_\-value}]Default value for the variables in the \hyperlink{classCSP}{CSP} when initialized \item[{\em set\_\-variables}]Decide whether mark the variables set with default\_\-value as \char`\"{}set\char`\"{} or \char`\"{}not set\char`\"{} (default: not set) \item[{\em c}]Boolean function representing the constraint of the \hyperlink{classCSP}{CSP} 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) \end{DoxyParams}
\subsubsection[{appendConstraint}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class T $>$ void {\bf CSP}$<$ T $>$::appendConstraint (bool($\ast$)(std::vector$<${\bf CSPvariable}$<$ T $>$$>$) {\em c})}}
\subsubsection[{domain}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class T $>$ std::vector$<$ T $>${\bf CSP}$<$ T $>$::domain (size\_\-t {\em index})\hspace{0.3cm}{\ttfamily\mbox{[}inline\mbox{]}}}}
\subsubsection[{dropConstraint}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class T $>$ void {\bf CSP}$<$ T $>$::dropConstraint (size\_\-t {\em index})\hspace{0.3cm}{\ttfamily\mbox{[}inline\mbox{]}}}}
\subsubsection[{hasUniqueSolution}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class T $>$ bool {\bf CSP}$<$ T $>$::hasUniqueSolution (void)\hspace{0.3cm}{\ttfamily\mbox{[}inline\mbox{]}}}}
Check if the \hyperlink{classCSP}{CSP}, with the given variables, domains and constraints, admits a unique solution, i.e. each domain of each variable contains an only element.
\begin{DoxyReturn}{Returns}
true if the \hyperlink{classCSP}{CSP} has an only possible solution, false otherwise
\subsubsection[{isSatisfiable}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class T $>$ bool {\bf CSP}$<$ T $>$::isSatisfiable (void)\hspace{0.3cm}{\ttfamily\mbox{[}inline\mbox{]}}}}
\subsubsection[{isSet}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class T $>$ bool {\bf CSP}$<$ T $>$::isSet (size\_\-t {\em i})\hspace{0.3cm}{\ttfamily\mbox{[}inline\mbox{]}}}}
\subsubsection[{refreshDomains}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class T $>$ void {\bf CSP}$<$ T $>$::refreshDomains (void)\hspace{0.3cm}{\ttfamily\mbox{[}inline\mbox{]}}}}
Updates the domains of the variables. Any constraint or node fixed value is applied.
\begin{DoxyParams}{Parameters}
\item[{\em max\_\-iterations}]Maximum number of iterations, after which the function will quit. This can be used to break endless loops in domains assignations. \end{DoxyParams}
\subsubsection[{setConstraint}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class T $>$ void {\bf CSP}$<$ T $>$::setConstraint (std::vector$<$ bool($\ast$)(std::vector$<${\bf CSPvariable}$<$ T $>$$>$) $>${\em c})\hspace{0.3cm}{\ttfamily\mbox{[}inline\mbox{]}}}}
\subsubsection[{setConstraint}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class T $>$ void {\bf CSP}$<$ T $>$::setConstraint (bool($\ast$)(std::vector$<${\bf CSPvariable}$<$ T $>$$>$) {\em c})}}
\subsubsection[{setDomain}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class T $>$ void {\bf CSP}$<$ T $>$::setDomain (size\_\-t {\em index}, \/ T {\em domain}\mbox{[}$\,$\mbox{]}, \/ int {\em size})\hspace{0.3cm}{\ttfamily\mbox{[}inline\mbox{]}}}}
\item[{\em index}]Variable for which we're setting the domain \item[{\em domain}]Array containing the possible values for that variable \item[{\em size}]Size of \char`\"{}domain\char`\"{} array \end{DoxyParams}
\subsubsection[{setDomain}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class T $>$ void {\bf CSP}$<$ T $>$::setDomain (size\_\-t {\em index}, \/ std::vector$<$ T $>${\em domain})}}
\item[{\em index}]Variable for which we're setting the domain \item[{\em domain}]Vector containing the possible values for that variable \end{DoxyParams}
\subsubsection[{setValue}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class T $>$ void {\bf CSP}$<$ T $>$::setValue (size\_\-t {\em index}, \/ T {\em value})\hspace{0.3cm}{\ttfamily\mbox{[}inline\mbox{]}}}}
\subsubsection[{size}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class T $>$ size\_\-t {\bf CSP}$<$ T $>$::size (void)\hspace{0.3cm}{\ttfamily\mbox{[}inline\mbox{]}}}}
\subsubsection[{unsetValue}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class T $>$ void {\bf CSP}$<$ T $>$::unsetValue (size\_\-t {\em index})\hspace{0.3cm}{\ttfamily\mbox{[}inline\mbox{]}}}}
Marks a variable as not set, and if a default value was assigned in the \hyperlink{classCSP}{CSP} constructor, this value will be set. By default, unless specified in the constructor, all the variables are considered as not set.
\begin{DoxyParams}{Parameters}
\item[{\em index}]Index of the variable to be unset \end{DoxyParams}
\subsubsection[{value}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class T $>$ T {\bf CSP}$<$ T $>$::value (size\_\-t {\em i})\hspace{0.3cm}{\ttfamily\mbox{[}inline\mbox{]}}}}
Get the value of the i-\/th variable of the \hyperlink{classCSP}{CSP}. Be careful: before using this function you should check whether the variable you're going to check is actually set, using the \hyperlink{classCSP_a213dafc1aae7b1825371810a511eca4f}{isSet()} method, unless you know what you're doing, in order to avoid reading inconsistent data.
\begin{DoxyParams}{Parameters}
\item[{\em i}]Index of the variable to get \end{DoxyParams}
\begin{DoxyReturn}{Returns}
The value of the variable, if the variable exists
\end{DoxyReturn}
The documentation for this class was generated from the following files:\begin{DoxyCompactItemize}