MLPACK  1.0.4
Public Member Functions | Private Attributes
mlpack::kernel::TriangularKernel Class Reference

The trivially simple triangular kernel, defined by. More...

List of all members.

Public Member Functions

 TriangularKernel (const double bandwidth=1.0)
 Initialize the triangular kernel with the given bandwidth (default 1.0).
double Bandwidth () const
 Get the bandwidth of the kernel.
double & Bandwidth ()
 Modify the bandwidth of the kernel.
template<typename Vec1Type , typename Vec2Type >
double Evaluate (const Vec1Type &a, const Vec2Type &b)
 Evaluate the triangular kernel for the two given vectors.

Private Attributes

double bandwidth
 The bandwidth of the kernel.

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 40 of file triangular_kernel.hpp.


Constructor & Destructor Documentation

mlpack::kernel::TriangularKernel::TriangularKernel ( const double  bandwidth = 1.0) [inline]

Initialize the triangular kernel with the given bandwidth (default 1.0).

Parameters:
bandwidthBandwidth of the triangular kernel.

Definition at line 48 of file triangular_kernel.hpp.


Member Function Documentation

Get the bandwidth of the kernel.

Definition at line 64 of file triangular_kernel.hpp.

References bandwidth.

Modify the bandwidth of the kernel.

Definition at line 66 of file triangular_kernel.hpp.

References bandwidth.

template<typename Vec1Type , typename Vec2Type >
double mlpack::kernel::TriangularKernel::Evaluate ( const Vec1Type &  a,
const Vec2Type &  b 
) [inline]

Evaluate the triangular kernel for the two given vectors.

Parameters:
aFirst vector.
bSecond vector.

Definition at line 57 of file triangular_kernel.hpp.

References bandwidth, and mlpack::metric::LMetric< Power, TakeRoot >::Evaluate().


Member Data Documentation

The bandwidth of the kernel.

Definition at line 70 of file triangular_kernel.hpp.

Referenced by Bandwidth(), and Evaluate().


The documentation for this class was generated from the following file: