\section{Triangular\+Kernel Class Reference}
\label{classmlpack_1_1kernel_1_1TriangularKernel}\index{Triangular\+Kernel@{Triangular\+Kernel}}


The trivially simple triangular kernel, defined by.  


\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\textbf{ Triangular\+Kernel} (const double bandwidth=1.\+0)
\begin{DoxyCompactList}\small\item\em Initialize the triangular kernel with the given bandwidth (default 1.\+0). \end{DoxyCompactList}\item 
double \textbf{ Bandwidth} () const
\begin{DoxyCompactList}\small\item\em Get the bandwidth of the kernel. \end{DoxyCompactList}\item 
double \& \textbf{ Bandwidth} ()
\begin{DoxyCompactList}\small\item\em Modify the bandwidth of the kernel. \end{DoxyCompactList}\item 
{\footnotesize template$<$typename Vec\+TypeA , typename Vec\+TypeB $>$ }\\double \textbf{ Evaluate} (const Vec\+TypeA \&a, const Vec\+TypeB \&b) const
\begin{DoxyCompactList}\small\item\em Evaluate the triangular kernel for the two given vectors. \end{DoxyCompactList}\item 
double \textbf{ Evaluate} (const double distance) const
\begin{DoxyCompactList}\small\item\em Evaluate the triangular kernel given that the distance between the two points is known. \end{DoxyCompactList}\item 
double \textbf{ Gradient} (const double distance) const
\begin{DoxyCompactList}\small\item\em Evaluate the gradient of triangular kernel given that the distance between the two points is known. \end{DoxyCompactList}\item 
{\footnotesize template$<$typename Archive $>$ }\\void \textbf{ serialize} (Archive \&ar, const unsigned int)
\begin{DoxyCompactList}\small\item\em Serialize the kernel. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
The trivially simple triangular kernel, defined by. 

\[ K(x, y) = \max \{ 0, 1 - \frac{|| x - y ||_2}{b} \} \]

where $ b $ is the bandwidth of the kernel. 

Definition at line 30 of file triangular\+\_\+kernel.\+hpp.



\subsection{Constructor \& Destructor Documentation}
\mbox{\label{classmlpack_1_1kernel_1_1TriangularKernel_a98b424666885d8f2fad1842a0a2351ed}} 
\index{mlpack\+::kernel\+::\+Triangular\+Kernel@{mlpack\+::kernel\+::\+Triangular\+Kernel}!Triangular\+Kernel@{Triangular\+Kernel}}
\index{Triangular\+Kernel@{Triangular\+Kernel}!mlpack\+::kernel\+::\+Triangular\+Kernel@{mlpack\+::kernel\+::\+Triangular\+Kernel}}
\subsubsection{Triangular\+Kernel()}
{\footnotesize\ttfamily \textbf{ Triangular\+Kernel} (\begin{DoxyParamCaption}\item[{const double}]{bandwidth = {\ttfamily 1.0} }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Initialize the triangular kernel with the given bandwidth (default 1.\+0). 


\begin{DoxyParams}{Parameters}
{\em bandwidth} & Bandwidth of the triangular kernel. \\
\hline
\end{DoxyParams}


Definition at line 38 of file triangular\+\_\+kernel.\+hpp.



\subsection{Member Function Documentation}
\mbox{\label{classmlpack_1_1kernel_1_1TriangularKernel_ae9cbd816179d6c36036139ccc8fea8c8}} 
\index{mlpack\+::kernel\+::\+Triangular\+Kernel@{mlpack\+::kernel\+::\+Triangular\+Kernel}!Bandwidth@{Bandwidth}}
\index{Bandwidth@{Bandwidth}!mlpack\+::kernel\+::\+Triangular\+Kernel@{mlpack\+::kernel\+::\+Triangular\+Kernel}}
\subsubsection{Bandwidth()\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily double Bandwidth (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



Get the bandwidth of the kernel. 



Definition at line 90 of file triangular\+\_\+kernel.\+hpp.

\mbox{\label{classmlpack_1_1kernel_1_1TriangularKernel_a202e9a76b6f5f948e98e68a374ae8ea4}} 
\index{mlpack\+::kernel\+::\+Triangular\+Kernel@{mlpack\+::kernel\+::\+Triangular\+Kernel}!Bandwidth@{Bandwidth}}
\index{Bandwidth@{Bandwidth}!mlpack\+::kernel\+::\+Triangular\+Kernel@{mlpack\+::kernel\+::\+Triangular\+Kernel}}
\subsubsection{Bandwidth()\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily double\& Bandwidth (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Modify the bandwidth of the kernel. 



Definition at line 92 of file triangular\+\_\+kernel.\+hpp.

\mbox{\label{classmlpack_1_1kernel_1_1TriangularKernel_a84c3aeba25ea7703bd2d4f85a54301da}} 
\index{mlpack\+::kernel\+::\+Triangular\+Kernel@{mlpack\+::kernel\+::\+Triangular\+Kernel}!Evaluate@{Evaluate}}
\index{Evaluate@{Evaluate}!mlpack\+::kernel\+::\+Triangular\+Kernel@{mlpack\+::kernel\+::\+Triangular\+Kernel}}
\subsubsection{Evaluate()\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily double Evaluate (\begin{DoxyParamCaption}\item[{const Vec\+TypeA \&}]{a,  }\item[{const Vec\+TypeB \&}]{b }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



Evaluate the triangular kernel for the two given vectors. 


\begin{DoxyTemplParams}{Template Parameters}
{\em Vec\+TypeA} & Type of first vector. \\
\hline
{\em Vec\+TypeB} & Type of second vector. \\
\hline
\end{DoxyTemplParams}

\begin{DoxyParams}{Parameters}
{\em a} & First vector. \\
\hline
{\em b} & Second vector. \\
\hline
\end{DoxyParams}


Definition at line 49 of file triangular\+\_\+kernel.\+hpp.



References L\+Metric$<$ T\+Power, T\+Take\+Root $>$\+::\+Evaluate().

\mbox{\label{classmlpack_1_1kernel_1_1TriangularKernel_a5602dee5d3ad98a183b9a11d9e0ed225}} 
\index{mlpack\+::kernel\+::\+Triangular\+Kernel@{mlpack\+::kernel\+::\+Triangular\+Kernel}!Evaluate@{Evaluate}}
\index{Evaluate@{Evaluate}!mlpack\+::kernel\+::\+Triangular\+Kernel@{mlpack\+::kernel\+::\+Triangular\+Kernel}}
\subsubsection{Evaluate()\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily double Evaluate (\begin{DoxyParamCaption}\item[{const double}]{distance }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



Evaluate the triangular kernel given that the distance between the two points is known. 


\begin{DoxyParams}{Parameters}
{\em distance} & The distance between the two points. \\
\hline
\end{DoxyParams}


Definition at line 61 of file triangular\+\_\+kernel.\+hpp.

\mbox{\label{classmlpack_1_1kernel_1_1TriangularKernel_ac83f017e98c3f23c603fb26b50b82cfd}} 
\index{mlpack\+::kernel\+::\+Triangular\+Kernel@{mlpack\+::kernel\+::\+Triangular\+Kernel}!Gradient@{Gradient}}
\index{Gradient@{Gradient}!mlpack\+::kernel\+::\+Triangular\+Kernel@{mlpack\+::kernel\+::\+Triangular\+Kernel}}
\subsubsection{Gradient()}
{\footnotesize\ttfamily double Gradient (\begin{DoxyParamCaption}\item[{const double}]{distance }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



Evaluate the gradient of triangular kernel given that the distance between the two points is known. 


\begin{DoxyParams}{Parameters}
{\em distance} & The distance between the two points. \\
\hline
\end{DoxyParams}


Definition at line 73 of file triangular\+\_\+kernel.\+hpp.

\mbox{\label{classmlpack_1_1kernel_1_1TriangularKernel_af0dd9205158ccf7bcfcd8ff81f79c927}} 
\index{mlpack\+::kernel\+::\+Triangular\+Kernel@{mlpack\+::kernel\+::\+Triangular\+Kernel}!serialize@{serialize}}
\index{serialize@{serialize}!mlpack\+::kernel\+::\+Triangular\+Kernel@{mlpack\+::kernel\+::\+Triangular\+Kernel}}
\subsubsection{serialize()}
{\footnotesize\ttfamily void serialize (\begin{DoxyParamCaption}\item[{Archive \&}]{ar,  }\item[{const unsigned}]{int }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Serialize the kernel. 



Definition at line 96 of file triangular\+\_\+kernel.\+hpp.



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/core/kernels/\textbf{ triangular\+\_\+kernel.\+hpp}\end{DoxyCompactItemize}
