\section{Traversal\+Info$<$ Tree\+Type $>$ Class Template Reference}
\label{classmlpack_1_1tree_1_1TraversalInfo}\index{Traversal\+Info$<$ Tree\+Type $>$@{Traversal\+Info$<$ Tree\+Type $>$}}


The \doxyref{Traversal\+Info}{p.}{classmlpack_1_1tree_1_1TraversalInfo} class holds traversal information which is used in dual-\/tree (and single-\/tree) traversals.  


\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\textbf{ Traversal\+Info} ()
\begin{DoxyCompactList}\small\item\em Create the \doxyref{Traversal\+Info}{p.}{classmlpack_1_1tree_1_1TraversalInfo} object and initialize the pointers to N\+U\+LL. \end{DoxyCompactList}\item 
double \textbf{ Last\+Base\+Case} () const
\begin{DoxyCompactList}\small\item\em Get the base case associated with the last node combination. \end{DoxyCompactList}\item 
double \& \textbf{ Last\+Base\+Case} ()
\begin{DoxyCompactList}\small\item\em Modify the base case associated with the last node combination. \end{DoxyCompactList}\item 
Tree\+Type $\ast$ \textbf{ Last\+Query\+Node} () const
\begin{DoxyCompactList}\small\item\em Get the last query node. \end{DoxyCompactList}\item 
Tree\+Type $\ast$\& \textbf{ Last\+Query\+Node} ()
\begin{DoxyCompactList}\small\item\em Modify the last query node. \end{DoxyCompactList}\item 
Tree\+Type $\ast$ \textbf{ Last\+Reference\+Node} () const
\begin{DoxyCompactList}\small\item\em Get the last reference node. \end{DoxyCompactList}\item 
Tree\+Type $\ast$\& \textbf{ Last\+Reference\+Node} ()
\begin{DoxyCompactList}\small\item\em Modify the last reference node. \end{DoxyCompactList}\item 
double \textbf{ Last\+Score} () const
\begin{DoxyCompactList}\small\item\em Get the score associated with the last query and reference nodes. \end{DoxyCompactList}\item 
double \& \textbf{ Last\+Score} ()
\begin{DoxyCompactList}\small\item\em Modify the score associated with the last query and reference nodes. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
\subsubsection*{template$<$typename Tree\+Type$>$\newline
class mlpack\+::tree\+::\+Traversal\+Info$<$ Tree\+Type $>$}

The \doxyref{Traversal\+Info}{p.}{classmlpack_1_1tree_1_1TraversalInfo} class holds traversal information which is used in dual-\/tree (and single-\/tree) traversals. 

A traversal should be updating the members of this class before Score() is called. This class should be held as a member of the Rule\+Type class and the interface to it should be through a \doxyref{Traversal\+Info()}{p.}{classmlpack_1_1tree_1_1TraversalInfo_a1ea7365c8870a18471fbe685af8a93c1} method.

The information held by this class is the last node combination visited before the current node combination was recursed into, and the score resulting from when Score() was called on that combination. However, this information is identical for a query node and a reference node in a particular node combination, so traversals only need to update the \doxyref{Traversal\+Info}{p.}{classmlpack_1_1tree_1_1TraversalInfo} object in a query node (and the algorithms should only use the \doxyref{Traversal\+Info}{p.}{classmlpack_1_1tree_1_1TraversalInfo} object from a query node).

In general, this auxiliary traversal information is used to try and make a prune without needing to call Base\+Case() or calculate the distance between nodes. Using this information you can place bounds on the distance between the two nodes quickly.

If the traversal is not updating the members of this class correctly, a likely result is a null pointer dereference. Dual-\/tree algorithms should assume that the members are set properly and should not need to check for null pointers.

There is one exception, which is the root node combination; the score can be set to 0 and the query and reference nodes can just be set to the root nodes; no algorithm should be able to prune the root combination anyway. 

Definition at line 50 of file traversal\+\_\+info.\+hpp.



\subsection{Constructor \& Destructor Documentation}
\mbox{\label{classmlpack_1_1tree_1_1TraversalInfo_a1ea7365c8870a18471fbe685af8a93c1}} 
\index{mlpack\+::tree\+::\+Traversal\+Info@{mlpack\+::tree\+::\+Traversal\+Info}!Traversal\+Info@{Traversal\+Info}}
\index{Traversal\+Info@{Traversal\+Info}!mlpack\+::tree\+::\+Traversal\+Info@{mlpack\+::tree\+::\+Traversal\+Info}}
\subsubsection{Traversal\+Info()}
{\footnotesize\ttfamily \textbf{ Traversal\+Info} (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Create the \doxyref{Traversal\+Info}{p.}{classmlpack_1_1tree_1_1TraversalInfo} object and initialize the pointers to N\+U\+LL. 



Definition at line 56 of file traversal\+\_\+info.\+hpp.



\subsection{Member Function Documentation}
\mbox{\label{classmlpack_1_1tree_1_1TraversalInfo_a396c1897a37eabe0501694f1273724b8}} 
\index{mlpack\+::tree\+::\+Traversal\+Info@{mlpack\+::tree\+::\+Traversal\+Info}!Last\+Base\+Case@{Last\+Base\+Case}}
\index{Last\+Base\+Case@{Last\+Base\+Case}!mlpack\+::tree\+::\+Traversal\+Info@{mlpack\+::tree\+::\+Traversal\+Info}}
\subsubsection{Last\+Base\+Case()\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily double Last\+Base\+Case (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



Get the base case associated with the last node combination. 



Definition at line 78 of file traversal\+\_\+info.\+hpp.

\mbox{\label{classmlpack_1_1tree_1_1TraversalInfo_a9843847879aa1003924dbb1b70bddaf2}} 
\index{mlpack\+::tree\+::\+Traversal\+Info@{mlpack\+::tree\+::\+Traversal\+Info}!Last\+Base\+Case@{Last\+Base\+Case}}
\index{Last\+Base\+Case@{Last\+Base\+Case}!mlpack\+::tree\+::\+Traversal\+Info@{mlpack\+::tree\+::\+Traversal\+Info}}
\subsubsection{Last\+Base\+Case()\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily double\& Last\+Base\+Case (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Modify the base case associated with the last node combination. 



Definition at line 80 of file traversal\+\_\+info.\+hpp.

\mbox{\label{classmlpack_1_1tree_1_1TraversalInfo_a240b4e3c069d0abebd0842000cae156d}} 
\index{mlpack\+::tree\+::\+Traversal\+Info@{mlpack\+::tree\+::\+Traversal\+Info}!Last\+Query\+Node@{Last\+Query\+Node}}
\index{Last\+Query\+Node@{Last\+Query\+Node}!mlpack\+::tree\+::\+Traversal\+Info@{mlpack\+::tree\+::\+Traversal\+Info}}
\subsubsection{Last\+Query\+Node()\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily Tree\+Type$\ast$ Last\+Query\+Node (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



Get the last query node. 



Definition at line 63 of file traversal\+\_\+info.\+hpp.

\mbox{\label{classmlpack_1_1tree_1_1TraversalInfo_a73879eca4d456d15499133f852ff7a78}} 
\index{mlpack\+::tree\+::\+Traversal\+Info@{mlpack\+::tree\+::\+Traversal\+Info}!Last\+Query\+Node@{Last\+Query\+Node}}
\index{Last\+Query\+Node@{Last\+Query\+Node}!mlpack\+::tree\+::\+Traversal\+Info@{mlpack\+::tree\+::\+Traversal\+Info}}
\subsubsection{Last\+Query\+Node()\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily Tree\+Type$\ast$\& Last\+Query\+Node (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Modify the last query node. 



Definition at line 65 of file traversal\+\_\+info.\+hpp.

\mbox{\label{classmlpack_1_1tree_1_1TraversalInfo_af07facd9a7140804dac091df72bffa92}} 
\index{mlpack\+::tree\+::\+Traversal\+Info@{mlpack\+::tree\+::\+Traversal\+Info}!Last\+Reference\+Node@{Last\+Reference\+Node}}
\index{Last\+Reference\+Node@{Last\+Reference\+Node}!mlpack\+::tree\+::\+Traversal\+Info@{mlpack\+::tree\+::\+Traversal\+Info}}
\subsubsection{Last\+Reference\+Node()\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily Tree\+Type$\ast$ Last\+Reference\+Node (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



Get the last reference node. 



Definition at line 68 of file traversal\+\_\+info.\+hpp.

\mbox{\label{classmlpack_1_1tree_1_1TraversalInfo_a163f1e230d32c86f66e1575c00cd2197}} 
\index{mlpack\+::tree\+::\+Traversal\+Info@{mlpack\+::tree\+::\+Traversal\+Info}!Last\+Reference\+Node@{Last\+Reference\+Node}}
\index{Last\+Reference\+Node@{Last\+Reference\+Node}!mlpack\+::tree\+::\+Traversal\+Info@{mlpack\+::tree\+::\+Traversal\+Info}}
\subsubsection{Last\+Reference\+Node()\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily Tree\+Type$\ast$\& Last\+Reference\+Node (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Modify the last reference node. 



Definition at line 70 of file traversal\+\_\+info.\+hpp.

\mbox{\label{classmlpack_1_1tree_1_1TraversalInfo_abebc9923f270ea47c68b1f09d6e13ddb}} 
\index{mlpack\+::tree\+::\+Traversal\+Info@{mlpack\+::tree\+::\+Traversal\+Info}!Last\+Score@{Last\+Score}}
\index{Last\+Score@{Last\+Score}!mlpack\+::tree\+::\+Traversal\+Info@{mlpack\+::tree\+::\+Traversal\+Info}}
\subsubsection{Last\+Score()\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily double Last\+Score (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



Get the score associated with the last query and reference nodes. 



Definition at line 73 of file traversal\+\_\+info.\+hpp.

\mbox{\label{classmlpack_1_1tree_1_1TraversalInfo_a52c6142d80e7c08d1234b18a23076364}} 
\index{mlpack\+::tree\+::\+Traversal\+Info@{mlpack\+::tree\+::\+Traversal\+Info}!Last\+Score@{Last\+Score}}
\index{Last\+Score@{Last\+Score}!mlpack\+::tree\+::\+Traversal\+Info@{mlpack\+::tree\+::\+Traversal\+Info}}
\subsubsection{Last\+Score()\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily double\& Last\+Score (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Modify the score associated with the last query and reference nodes. 



Definition at line 75 of file traversal\+\_\+info.\+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/core/tree/\textbf{ traversal\+\_\+info.\+hpp}\end{DoxyCompactItemize}
