mlpack  1.0.12
Public Member Functions | Static Public Member Functions | List of all members
mlpack::kernel::LinearKernel Class Reference

The simple linear kernel (dot product). More...

Public Member Functions

 LinearKernel ()
 This constructor does nothing; the linear kernel has no parameters to store. More...
 
std::string ToString () const
 Return a string representation of the kernel. More...
 

Static Public Member Functions

template<typename VecType >
static double Evaluate (const VecType &a, const VecType &b)
 Simple evaluation of the dot product. More...
 

Detailed Description

The simple linear kernel (dot product).

For any two vectors $ x $ and $ y $,

\[ K(x, y) = x^T y \]

This kernel has no parameters and therefore the evaluation can be static.

Definition at line 34 of file linear_kernel.hpp.

Constructor & Destructor Documentation

mlpack::kernel::LinearKernel::LinearKernel ( )
inline

This constructor does nothing; the linear kernel has no parameters to store.

Definition at line 41 of file linear_kernel.hpp.

Member Function Documentation

template<typename VecType >
static double mlpack::kernel::LinearKernel::Evaluate ( const VecType &  a,
const VecType &  b 
)
inlinestatic

Simple evaluation of the dot product.

This evaluation uses Armadillo's dot() function.

Template Parameters
VecTypeType of vector (should be arma::vec or arma::spvec).
Parameters
aFirst vector.
bSecond vector.
Returns
K(a, b).

Definition at line 53 of file linear_kernel.hpp.

std::string mlpack::kernel::LinearKernel::ToString ( ) const
inline

Return a string representation of the kernel.

Definition at line 59 of file linear_kernel.hpp.


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