\section{Path\+Cacher Class Reference}
\label{classmlpack_1_1det_1_1PathCacher}\index{Path\+Cacher@{Path\+Cacher}}


This class is responsible for caching the path to each node of the tree.  


\subsection*{Public Types}
\begin{DoxyCompactItemize}
\item 
enum \textbf{ Path\+Format} \{ \newline
\textbf{ Format\+LR}, 
\newline
\textbf{ Format\+L\+R\+\_\+\+ID}, 
\newline
\textbf{ Format\+I\+D\+\_\+\+LR}
 \}\begin{DoxyCompactList}\small\item\em Possible formats to use for output. \end{DoxyCompactList}
\end{DoxyCompactItemize}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
{\footnotesize template$<$typename Mat\+Type $>$ }\\\textbf{ Path\+Cacher} (\textbf{ Path\+Format} fmt, \textbf{ D\+Tree}$<$ Mat\+Type, int $>$ $\ast$tree)
\begin{DoxyCompactList}\small\item\em Construct a \doxyref{Path\+Cacher}{p.}{classmlpack_1_1det_1_1PathCacher} object on the given tree with the given format. \end{DoxyCompactList}\item 
{\footnotesize template$<$typename Mat\+Type $>$ }\\void \textbf{ Enter} (const \textbf{ D\+Tree}$<$ Mat\+Type, int $>$ $\ast$node, const \textbf{ D\+Tree}$<$ Mat\+Type, int $>$ $\ast$parent)
\begin{DoxyCompactList}\small\item\em Enter a given node. \end{DoxyCompactList}\item 
{\footnotesize template$<$typename Mat\+Type $>$ }\\void \textbf{ Leave} (const \textbf{ D\+Tree}$<$ Mat\+Type, int $>$ $\ast$node, const \textbf{ D\+Tree}$<$ Mat\+Type, int $>$ $\ast$parent)
\begin{DoxyCompactList}\small\item\em Leave the given node. \end{DoxyCompactList}\item 
size\+\_\+t \textbf{ Num\+Nodes} () const
\begin{DoxyCompactList}\small\item\em Get the number of nodes in the path cache. \end{DoxyCompactList}\item 
int \textbf{ Parent\+Of} (int tag) const
\begin{DoxyCompactList}\small\item\em Get the parent tag of a given tag. \end{DoxyCompactList}\item 
const std\+::string \& \textbf{ Path\+For} (int tag) const
\begin{DoxyCompactList}\small\item\em Return the constructed path for a given tag. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Protected Types}
\begin{DoxyCompactItemize}
\item 
typedef std\+::vector$<$ std\+::pair$<$ int, std\+::string $>$ $>$ \textbf{ Path\+Cache\+Type}
\item 
typedef std\+::list$<$ std\+::pair$<$ bool, int $>$ $>$ \textbf{ Path\+Type}
\end{DoxyCompactItemize}
\subsection*{Protected Member Functions}
\begin{DoxyCompactItemize}
\item 
std\+::string \textbf{ Build\+String} ()
\end{DoxyCompactItemize}
\subsection*{Protected Attributes}
\begin{DoxyCompactItemize}
\item 
\textbf{ Path\+Format} \textbf{ format}
\item 
\textbf{ Path\+Type} \textbf{ path}
\item 
\textbf{ Path\+Cache\+Type} \textbf{ path\+Cache}
\end{DoxyCompactItemize}


\subsection{Detailed Description}
This class is responsible for caching the path to each node of the tree. 

Its instance is provided to \doxyref{Enumerate\+Tree()}{p.}{namespacemlpack_1_1tree_abab37b0038f14ab4dcdf83c60468e923} utility O\+N\+CE and it caches the paths to all the leafs and then easily (and quickly) retrieves these paths for each test entry. 

Definition at line 80 of file dt\+\_\+utils.\+hpp.



\subsection{Member Typedef Documentation}
\mbox{\label{classmlpack_1_1det_1_1PathCacher_a3556ea9f8a86ca23b6c205c23f0e0f11}} 
\index{mlpack\+::det\+::\+Path\+Cacher@{mlpack\+::det\+::\+Path\+Cacher}!Path\+Cache\+Type@{Path\+Cache\+Type}}
\index{Path\+Cache\+Type@{Path\+Cache\+Type}!mlpack\+::det\+::\+Path\+Cacher@{mlpack\+::det\+::\+Path\+Cacher}}
\subsubsection{Path\+Cache\+Type}
{\footnotesize\ttfamily typedef std\+::vector$<$std\+::pair$<$int, std\+::string$>$ $>$ \textbf{ Path\+Cache\+Type}\hspace{0.3cm}{\ttfamily [protected]}}



Definition at line 136 of file dt\+\_\+utils.\+hpp.

\mbox{\label{classmlpack_1_1det_1_1PathCacher_af21ffd6b8b037b9235c00547b371def3}} 
\index{mlpack\+::det\+::\+Path\+Cacher@{mlpack\+::det\+::\+Path\+Cacher}!Path\+Type@{Path\+Type}}
\index{Path\+Type@{Path\+Type}!mlpack\+::det\+::\+Path\+Cacher@{mlpack\+::det\+::\+Path\+Cacher}}
\subsubsection{Path\+Type}
{\footnotesize\ttfamily typedef std\+::list$<$std\+::pair$<$bool, int$>$ $>$ \textbf{ Path\+Type}\hspace{0.3cm}{\ttfamily [protected]}}



Definition at line 135 of file dt\+\_\+utils.\+hpp.



\subsection{Member Enumeration Documentation}
\mbox{\label{classmlpack_1_1det_1_1PathCacher_ad42c791e18217f9f8ec4b75e3b832d59}} 
\index{mlpack\+::det\+::\+Path\+Cacher@{mlpack\+::det\+::\+Path\+Cacher}!Path\+Format@{Path\+Format}}
\index{Path\+Format@{Path\+Format}!mlpack\+::det\+::\+Path\+Cacher@{mlpack\+::det\+::\+Path\+Cacher}}
\subsubsection{Path\+Format}
{\footnotesize\ttfamily enum \textbf{ Path\+Format}}



Possible formats to use for output. 

\begin{DoxyEnumFields}{Enumerator}
\raisebox{\heightof{T}}[0pt][0pt]{\index{Format\+LR@{Format\+LR}!mlpack\+::det\+::\+Path\+Cacher@{mlpack\+::det\+::\+Path\+Cacher}}\index{mlpack\+::det\+::\+Path\+Cacher@{mlpack\+::det\+::\+Path\+Cacher}!Format\+LR@{Format\+LR}}}\mbox{\label{classmlpack_1_1det_1_1PathCacher_ad42c791e18217f9f8ec4b75e3b832d59a5e04095213d836ceee073d53425709e1}} 
Format\+LR&Print only whether we went left or right. \\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{Format\+L\+R\+\_\+\+ID@{Format\+L\+R\+\_\+\+ID}!mlpack\+::det\+::\+Path\+Cacher@{mlpack\+::det\+::\+Path\+Cacher}}\index{mlpack\+::det\+::\+Path\+Cacher@{mlpack\+::det\+::\+Path\+Cacher}!Format\+L\+R\+\_\+\+ID@{Format\+L\+R\+\_\+\+ID}}}\mbox{\label{classmlpack_1_1det_1_1PathCacher_ad42c791e18217f9f8ec4b75e3b832d59ab0b26eeb16bd5e237d3c4149f81d1b24}} 
Format\+L\+R\+\_\+\+ID&Print the direction, then the tag of the node. \\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{Format\+I\+D\+\_\+\+LR@{Format\+I\+D\+\_\+\+LR}!mlpack\+::det\+::\+Path\+Cacher@{mlpack\+::det\+::\+Path\+Cacher}}\index{mlpack\+::det\+::\+Path\+Cacher@{mlpack\+::det\+::\+Path\+Cacher}!Format\+I\+D\+\_\+\+LR@{Format\+I\+D\+\_\+\+LR}}}\mbox{\label{classmlpack_1_1det_1_1PathCacher_ad42c791e18217f9f8ec4b75e3b832d59a3a8b8d2daa2fad886dfb77b20737a2e1}} 
Format\+I\+D\+\_\+\+LR&Print the tag of the node, then the direction. \\
\hline

\end{DoxyEnumFields}


Definition at line 86 of file dt\+\_\+utils.\+hpp.



\subsection{Constructor \& Destructor Documentation}
\mbox{\label{classmlpack_1_1det_1_1PathCacher_ac2117a674303c683520652b1e3506cc5}} 
\index{mlpack\+::det\+::\+Path\+Cacher@{mlpack\+::det\+::\+Path\+Cacher}!Path\+Cacher@{Path\+Cacher}}
\index{Path\+Cacher@{Path\+Cacher}!mlpack\+::det\+::\+Path\+Cacher@{mlpack\+::det\+::\+Path\+Cacher}}
\subsubsection{Path\+Cacher()}
{\footnotesize\ttfamily \textbf{ Path\+Cacher} (\begin{DoxyParamCaption}\item[{\textbf{ Path\+Format}}]{fmt,  }\item[{\textbf{ D\+Tree}$<$ Mat\+Type, int $>$ $\ast$}]{tree }\end{DoxyParamCaption})}



Construct a \doxyref{Path\+Cacher}{p.}{classmlpack_1_1det_1_1PathCacher} object on the given tree with the given format. 


\begin{DoxyParams}{Parameters}
{\em fmt} & Format to use for output. \\
\hline
{\em tree} & Tree to cache paths in. \\
\hline
\end{DoxyParams}


\subsection{Member Function Documentation}
\mbox{\label{classmlpack_1_1det_1_1PathCacher_ad564bef941bc27ad1a335367f504af66}} 
\index{mlpack\+::det\+::\+Path\+Cacher@{mlpack\+::det\+::\+Path\+Cacher}!Build\+String@{Build\+String}}
\index{Build\+String@{Build\+String}!mlpack\+::det\+::\+Path\+Cacher@{mlpack\+::det\+::\+Path\+Cacher}}
\subsubsection{Build\+String()}
{\footnotesize\ttfamily std\+::string Build\+String (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [protected]}}

\mbox{\label{classmlpack_1_1det_1_1PathCacher_a7825e68e15d3d8cc33e44db3d0801527}} 
\index{mlpack\+::det\+::\+Path\+Cacher@{mlpack\+::det\+::\+Path\+Cacher}!Enter@{Enter}}
\index{Enter@{Enter}!mlpack\+::det\+::\+Path\+Cacher@{mlpack\+::det\+::\+Path\+Cacher}}
\subsubsection{Enter()}
{\footnotesize\ttfamily void Enter (\begin{DoxyParamCaption}\item[{const \textbf{ D\+Tree}$<$ Mat\+Type, int $>$ $\ast$}]{node,  }\item[{const \textbf{ D\+Tree}$<$ Mat\+Type, int $>$ $\ast$}]{parent }\end{DoxyParamCaption})}



Enter a given node. 

\mbox{\label{classmlpack_1_1det_1_1PathCacher_a1cac9b036f3b4aadf7bbf098d65ff37e}} 
\index{mlpack\+::det\+::\+Path\+Cacher@{mlpack\+::det\+::\+Path\+Cacher}!Leave@{Leave}}
\index{Leave@{Leave}!mlpack\+::det\+::\+Path\+Cacher@{mlpack\+::det\+::\+Path\+Cacher}}
\subsubsection{Leave()}
{\footnotesize\ttfamily void Leave (\begin{DoxyParamCaption}\item[{const \textbf{ D\+Tree}$<$ Mat\+Type, int $>$ $\ast$}]{node,  }\item[{const \textbf{ D\+Tree}$<$ Mat\+Type, int $>$ $\ast$}]{parent }\end{DoxyParamCaption})}



Leave the given node. 

\mbox{\label{classmlpack_1_1det_1_1PathCacher_a5745ee58508df730d6557dc103ede353}} 
\index{mlpack\+::det\+::\+Path\+Cacher@{mlpack\+::det\+::\+Path\+Cacher}!Num\+Nodes@{Num\+Nodes}}
\index{Num\+Nodes@{Num\+Nodes}!mlpack\+::det\+::\+Path\+Cacher@{mlpack\+::det\+::\+Path\+Cacher}}
\subsubsection{Num\+Nodes()}
{\footnotesize\ttfamily size\+\_\+t Num\+Nodes (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



Get the number of nodes in the path cache. 



Definition at line 132 of file dt\+\_\+utils.\+hpp.



References Path\+Cacher\+::path\+Cache.

\mbox{\label{classmlpack_1_1det_1_1PathCacher_ab3f0e671c8ef70476a2a3b0dffb3d24d}} 
\index{mlpack\+::det\+::\+Path\+Cacher@{mlpack\+::det\+::\+Path\+Cacher}!Parent\+Of@{Parent\+Of}}
\index{Parent\+Of@{Parent\+Of}!mlpack\+::det\+::\+Path\+Cacher@{mlpack\+::det\+::\+Path\+Cacher}}
\subsubsection{Parent\+Of()}
{\footnotesize\ttfamily int Parent\+Of (\begin{DoxyParamCaption}\item[{int}]{tag }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



Get the parent tag of a given tag. 

\mbox{\label{classmlpack_1_1det_1_1PathCacher_a1cf438e5bc7c1c934766705a081885d8}} 
\index{mlpack\+::det\+::\+Path\+Cacher@{mlpack\+::det\+::\+Path\+Cacher}!Path\+For@{Path\+For}}
\index{Path\+For@{Path\+For}!mlpack\+::det\+::\+Path\+Cacher@{mlpack\+::det\+::\+Path\+Cacher}}
\subsubsection{Path\+For()}
{\footnotesize\ttfamily const std\+::string\& Path\+For (\begin{DoxyParamCaption}\item[{int}]{tag }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



Return the constructed path for a given tag. 



\subsection{Member Data Documentation}
\mbox{\label{classmlpack_1_1det_1_1PathCacher_a2fbade9ce67adf733de0cbac35148550}} 
\index{mlpack\+::det\+::\+Path\+Cacher@{mlpack\+::det\+::\+Path\+Cacher}!format@{format}}
\index{format@{format}!mlpack\+::det\+::\+Path\+Cacher@{mlpack\+::det\+::\+Path\+Cacher}}
\subsubsection{format}
{\footnotesize\ttfamily \textbf{ Path\+Format} format\hspace{0.3cm}{\ttfamily [protected]}}



Definition at line 139 of file dt\+\_\+utils.\+hpp.

\mbox{\label{classmlpack_1_1det_1_1PathCacher_a137e67424ef34c606fa1dfea3e80ac12}} 
\index{mlpack\+::det\+::\+Path\+Cacher@{mlpack\+::det\+::\+Path\+Cacher}!path@{path}}
\index{path@{path}!mlpack\+::det\+::\+Path\+Cacher@{mlpack\+::det\+::\+Path\+Cacher}}
\subsubsection{path}
{\footnotesize\ttfamily \textbf{ Path\+Type} path\hspace{0.3cm}{\ttfamily [protected]}}



Definition at line 138 of file dt\+\_\+utils.\+hpp.

\mbox{\label{classmlpack_1_1det_1_1PathCacher_af671c808edc779f96d20c26e301d46be}} 
\index{mlpack\+::det\+::\+Path\+Cacher@{mlpack\+::det\+::\+Path\+Cacher}!path\+Cache@{path\+Cache}}
\index{path\+Cache@{path\+Cache}!mlpack\+::det\+::\+Path\+Cacher@{mlpack\+::det\+::\+Path\+Cacher}}
\subsubsection{path\+Cache}
{\footnotesize\ttfamily \textbf{ Path\+Cache\+Type} path\+Cache\hspace{0.3cm}{\ttfamily [protected]}}



Definition at line 140 of file dt\+\_\+utils.\+hpp.



Referenced by Path\+Cacher\+::\+Num\+Nodes().



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