\section{K\+D\+E\+Rules$<$ Metric\+Type, Kernel\+Type, Tree\+Type $>$ Class Template Reference}
\label{classmlpack_1_1kde_1_1KDERules}\index{K\+D\+E\+Rules$<$ Metric\+Type, Kernel\+Type, Tree\+Type $>$@{K\+D\+E\+Rules$<$ Metric\+Type, Kernel\+Type, Tree\+Type $>$}}


A dual-\/tree traversal Rules class for kernel density estimation.  


\subsection*{Public Types}
\begin{DoxyCompactItemize}
\item 
typedef \textbf{ tree\+::\+Traversal\+Info}$<$ Tree\+Type $>$ \textbf{ Traversal\+Info\+Type}
\end{DoxyCompactItemize}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\textbf{ K\+D\+E\+Rules} (const arma\+::mat \&reference\+Set, const arma\+::mat \&query\+Set, arma\+::vec \&densities, const double rel\+Error, const double abs\+Error, const double mc\+Prob, const size\+\_\+t initial\+Sample\+Size, const double mc\+Access\+Coef, const double mc\+Break\+Coef, Metric\+Type \&metric, Kernel\+Type \&kernel, const bool monte\+Carlo, const bool same\+Set)
\begin{DoxyCompactList}\small\item\em Construct \doxyref{K\+D\+E\+Rules}{p.}{classmlpack_1_1kde_1_1KDERules}. \end{DoxyCompactList}\item 
double \textbf{ Base\+Case} (const size\+\_\+t query\+Index, const size\+\_\+t reference\+Index)
\begin{DoxyCompactList}\small\item\em Base Case. \end{DoxyCompactList}\item 
size\+\_\+t \textbf{ Base\+Cases} () const
\begin{DoxyCompactList}\small\item\em Get the number of base cases. \end{DoxyCompactList}\item 
double \textbf{ Rescore} (const size\+\_\+t query\+Index, Tree\+Type \&reference\+Node, const double old\+Score) const
\begin{DoxyCompactList}\small\item\em Single\+Tree Score. \end{DoxyCompactList}\item 
double \textbf{ Rescore} (Tree\+Type \&query\+Node, Tree\+Type \&reference\+Node, const double old\+Score) const
\begin{DoxyCompactList}\small\item\em Dual-\/\+Tree Rescore. \end{DoxyCompactList}\item 
double \textbf{ Score} (const size\+\_\+t query\+Index, Tree\+Type \&reference\+Node)
\begin{DoxyCompactList}\small\item\em Single\+Tree Rescore. \end{DoxyCompactList}\item 
double \textbf{ Score} (Tree\+Type \&query\+Node, Tree\+Type \&reference\+Node)
\begin{DoxyCompactList}\small\item\em Dual-\/\+Tree Score. \end{DoxyCompactList}\item 
size\+\_\+t \textbf{ Scores} () const
\begin{DoxyCompactList}\small\item\em Get the number of scores. \end{DoxyCompactList}\item 
const \textbf{ Traversal\+Info\+Type} \& \textbf{ Traversal\+Info} () const
\begin{DoxyCompactList}\small\item\em Get traversal information. \end{DoxyCompactList}\item 
\textbf{ Traversal\+Info\+Type} \& \textbf{ Traversal\+Info} ()
\begin{DoxyCompactList}\small\item\em Modify traversal information. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
\subsubsection*{template$<$typename Metric\+Type, typename Kernel\+Type, typename Tree\+Type$>$\newline
class mlpack\+::kde\+::\+K\+D\+E\+Rules$<$ Metric\+Type, Kernel\+Type, Tree\+Type $>$}

A dual-\/tree traversal Rules class for kernel density estimation. 

This contains the \doxyref{Score()}{p.}{classmlpack_1_1kde_1_1KDERules_a53d373b7aeee359b0e686f823c602b1c} and \doxyref{Base\+Case()}{p.}{classmlpack_1_1kde_1_1KDERules_abac50f780bb5e1bc12dd0d16d850cacc} implementations. 

Definition at line 26 of file kde\+\_\+rules.\+hpp.



\subsection{Member Typedef Documentation}
\mbox{\label{classmlpack_1_1kde_1_1KDERules_ab5f079db10d0a6813eefeb1115e894cb}} 
\index{mlpack\+::kde\+::\+K\+D\+E\+Rules@{mlpack\+::kde\+::\+K\+D\+E\+Rules}!Traversal\+Info\+Type@{Traversal\+Info\+Type}}
\index{Traversal\+Info\+Type@{Traversal\+Info\+Type}!mlpack\+::kde\+::\+K\+D\+E\+Rules@{mlpack\+::kde\+::\+K\+D\+E\+Rules}}
\subsubsection{Traversal\+Info\+Type}
{\footnotesize\ttfamily typedef \textbf{ tree\+::\+Traversal\+Info}$<$Tree\+Type$>$ \textbf{ Traversal\+Info\+Type}}



Definition at line 82 of file kde\+\_\+rules.\+hpp.



\subsection{Constructor \& Destructor Documentation}
\mbox{\label{classmlpack_1_1kde_1_1KDERules_a6049807a617e88381ec447a426a93275}} 
\index{mlpack\+::kde\+::\+K\+D\+E\+Rules@{mlpack\+::kde\+::\+K\+D\+E\+Rules}!K\+D\+E\+Rules@{K\+D\+E\+Rules}}
\index{K\+D\+E\+Rules@{K\+D\+E\+Rules}!mlpack\+::kde\+::\+K\+D\+E\+Rules@{mlpack\+::kde\+::\+K\+D\+E\+Rules}}
\subsubsection{K\+D\+E\+Rules()}
{\footnotesize\ttfamily \textbf{ K\+D\+E\+Rules} (\begin{DoxyParamCaption}\item[{const arma\+::mat \&}]{reference\+Set,  }\item[{const arma\+::mat \&}]{query\+Set,  }\item[{arma\+::vec \&}]{densities,  }\item[{const double}]{rel\+Error,  }\item[{const double}]{abs\+Error,  }\item[{const double}]{mc\+Prob,  }\item[{const size\+\_\+t}]{initial\+Sample\+Size,  }\item[{const double}]{mc\+Access\+Coef,  }\item[{const double}]{mc\+Break\+Coef,  }\item[{Metric\+Type \&}]{metric,  }\item[{Kernel\+Type \&}]{kernel,  }\item[{const bool}]{monte\+Carlo,  }\item[{const bool}]{same\+Set }\end{DoxyParamCaption})}



Construct \doxyref{K\+D\+E\+Rules}{p.}{classmlpack_1_1kde_1_1KDERules}. 


\begin{DoxyParams}{Parameters}
{\em reference\+Set} & Reference set data. \\
\hline
{\em query\+Set} & Query set data. \\
\hline
{\em densities} & Vector where estimations will be written. \\
\hline
{\em rel\+Error} & Relative error tolerance. \\
\hline
{\em abs\+Error} & Absolute error tolerance. \\
\hline
{\em mc\+Prob} & Probability of relative error compliance for Monte Carlo estimations. \\
\hline
{\em initial\+Sample\+Size} & Initial size of the Monte Carlo samples. \\
\hline
{\em mc\+Access\+Coef} & Access coefficient for Monte Carlo estimations. \\
\hline
{\em mc\+Break\+Coef} & Break coefficient for Monte Carlo estimations. \\
\hline
{\em metric} & Instantiated metric. \\
\hline
{\em kernel} & Instantiated kernel. \\
\hline
{\em monte\+Carlo} & If true Monte Carlo estimations will be applied when possible. \\
\hline
{\em same\+Set} & True if query and reference sets are the same (monochromatic evaluation). \\
\hline
\end{DoxyParams}


\subsection{Member Function Documentation}
\mbox{\label{classmlpack_1_1kde_1_1KDERules_abac50f780bb5e1bc12dd0d16d850cacc}} 
\index{mlpack\+::kde\+::\+K\+D\+E\+Rules@{mlpack\+::kde\+::\+K\+D\+E\+Rules}!Base\+Case@{Base\+Case}}
\index{Base\+Case@{Base\+Case}!mlpack\+::kde\+::\+K\+D\+E\+Rules@{mlpack\+::kde\+::\+K\+D\+E\+Rules}}
\subsubsection{Base\+Case()}
{\footnotesize\ttfamily double Base\+Case (\begin{DoxyParamCaption}\item[{const size\+\_\+t}]{query\+Index,  }\item[{const size\+\_\+t}]{reference\+Index }\end{DoxyParamCaption})}



Base Case. 



Referenced by K\+D\+E\+Clean\+Rules$<$ Tree\+Type $>$\+::\+K\+D\+E\+Clean\+Rules().

\mbox{\label{classmlpack_1_1kde_1_1KDERules_a3f4bd5d0aa64ea090796725f7755287d}} 
\index{mlpack\+::kde\+::\+K\+D\+E\+Rules@{mlpack\+::kde\+::\+K\+D\+E\+Rules}!Base\+Cases@{Base\+Cases}}
\index{Base\+Cases@{Base\+Cases}!mlpack\+::kde\+::\+K\+D\+E\+Rules@{mlpack\+::kde\+::\+K\+D\+E\+Rules}}
\subsubsection{Base\+Cases()}
{\footnotesize\ttfamily size\+\_\+t Base\+Cases (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



Get the number of base cases. 



Definition at line 91 of file kde\+\_\+rules.\+hpp.

\mbox{\label{classmlpack_1_1kde_1_1KDERules_ae0ad46f30e80aadc5bc476d46886540f}} 
\index{mlpack\+::kde\+::\+K\+D\+E\+Rules@{mlpack\+::kde\+::\+K\+D\+E\+Rules}!Rescore@{Rescore}}
\index{Rescore@{Rescore}!mlpack\+::kde\+::\+K\+D\+E\+Rules@{mlpack\+::kde\+::\+K\+D\+E\+Rules}}
\subsubsection{Rescore()\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily double Rescore (\begin{DoxyParamCaption}\item[{const size\+\_\+t}]{query\+Index,  }\item[{Tree\+Type \&}]{reference\+Node,  }\item[{const double}]{old\+Score }\end{DoxyParamCaption}) const}



Single\+Tree Score. 

\mbox{\label{classmlpack_1_1kde_1_1KDERules_a536e5a7cbce35b9be7443775d32e11f5}} 
\index{mlpack\+::kde\+::\+K\+D\+E\+Rules@{mlpack\+::kde\+::\+K\+D\+E\+Rules}!Rescore@{Rescore}}
\index{Rescore@{Rescore}!mlpack\+::kde\+::\+K\+D\+E\+Rules@{mlpack\+::kde\+::\+K\+D\+E\+Rules}}
\subsubsection{Rescore()\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily double Rescore (\begin{DoxyParamCaption}\item[{Tree\+Type \&}]{query\+Node,  }\item[{Tree\+Type \&}]{reference\+Node,  }\item[{const double}]{old\+Score }\end{DoxyParamCaption}) const}



Dual-\/\+Tree Rescore. 

\mbox{\label{classmlpack_1_1kde_1_1KDERules_a53d373b7aeee359b0e686f823c602b1c}} 
\index{mlpack\+::kde\+::\+K\+D\+E\+Rules@{mlpack\+::kde\+::\+K\+D\+E\+Rules}!Score@{Score}}
\index{Score@{Score}!mlpack\+::kde\+::\+K\+D\+E\+Rules@{mlpack\+::kde\+::\+K\+D\+E\+Rules}}
\subsubsection{Score()\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily double Score (\begin{DoxyParamCaption}\item[{const size\+\_\+t}]{query\+Index,  }\item[{Tree\+Type \&}]{reference\+Node }\end{DoxyParamCaption})}



Single\+Tree Rescore. 



Referenced by K\+D\+E\+Clean\+Rules$<$ Tree\+Type $>$\+::\+K\+D\+E\+Clean\+Rules(), and K\+D\+E\+Clean\+Rules$<$ Tree\+Type $>$\+::\+Rescore().

\mbox{\label{classmlpack_1_1kde_1_1KDERules_a05b142945ef94221b628a75961f48b02}} 
\index{mlpack\+::kde\+::\+K\+D\+E\+Rules@{mlpack\+::kde\+::\+K\+D\+E\+Rules}!Score@{Score}}
\index{Score@{Score}!mlpack\+::kde\+::\+K\+D\+E\+Rules@{mlpack\+::kde\+::\+K\+D\+E\+Rules}}
\subsubsection{Score()\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily double Score (\begin{DoxyParamCaption}\item[{Tree\+Type \&}]{query\+Node,  }\item[{Tree\+Type \&}]{reference\+Node }\end{DoxyParamCaption})}



Dual-\/\+Tree Score. 

\mbox{\label{classmlpack_1_1kde_1_1KDERules_a4d1e40c0bf406280a237ca1b487e3c62}} 
\index{mlpack\+::kde\+::\+K\+D\+E\+Rules@{mlpack\+::kde\+::\+K\+D\+E\+Rules}!Scores@{Scores}}
\index{Scores@{Scores}!mlpack\+::kde\+::\+K\+D\+E\+Rules@{mlpack\+::kde\+::\+K\+D\+E\+Rules}}
\subsubsection{Scores()}
{\footnotesize\ttfamily size\+\_\+t Scores (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



Get the number of scores. 



Definition at line 94 of file kde\+\_\+rules.\+hpp.

\mbox{\label{classmlpack_1_1kde_1_1KDERules_ab5c6f4ae7c3b71b808403a7b7454f26f}} 
\index{mlpack\+::kde\+::\+K\+D\+E\+Rules@{mlpack\+::kde\+::\+K\+D\+E\+Rules}!Traversal\+Info@{Traversal\+Info}}
\index{Traversal\+Info@{Traversal\+Info}!mlpack\+::kde\+::\+K\+D\+E\+Rules@{mlpack\+::kde\+::\+K\+D\+E\+Rules}}
\subsubsection{Traversal\+Info()\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily const \textbf{ Traversal\+Info\+Type}\& Traversal\+Info (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



Get traversal information. 



Definition at line 85 of file kde\+\_\+rules.\+hpp.

\mbox{\label{classmlpack_1_1kde_1_1KDERules_a4027bb90e756a4520d55978459c7f83e}} 
\index{mlpack\+::kde\+::\+K\+D\+E\+Rules@{mlpack\+::kde\+::\+K\+D\+E\+Rules}!Traversal\+Info@{Traversal\+Info}}
\index{Traversal\+Info@{Traversal\+Info}!mlpack\+::kde\+::\+K\+D\+E\+Rules@{mlpack\+::kde\+::\+K\+D\+E\+Rules}}
\subsubsection{Traversal\+Info()\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily \textbf{ Traversal\+Info\+Type}\& Traversal\+Info (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Modify traversal information. 



Definition at line 88 of file kde\+\_\+rules.\+hpp.



The documentation for this class was generated from the following file\+:\begin{DoxyCompactItemize}
\item 
/var/www/mlpack.\+ratml.\+org/mlpack.\+org/\+\_\+src/mlpack-\/3.\+3.\+2/src/mlpack/methods/kde/\textbf{ kde\+\_\+rules.\+hpp}\end{DoxyCompactItemize}
