mlpack  master
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...
 
template<typename Archive >
void Serialize (Archive &, const unsigned int)
 Serialize the kernel (it has no members... do nothing). More...
 

Static Public Member Functions

template<typename VecTypeA , typename VecTypeB >
static double Evaluate (const VecTypeA &a, const VecTypeB &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 32 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 39 of file linear_kernel.hpp.

Member Function Documentation

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

Simple evaluation of the dot product.

This evaluation uses Armadillo's dot() function.

Template Parameters
VecTypeAType of first vector (should be arma::vec or arma::sp_vec).
VecTypeBType of second vector (arma::vec / arma::sp_vec).
Parameters
aFirst vector.
bSecond vector.
Returns
K(a, b).

Definition at line 53 of file linear_kernel.hpp.

template<typename Archive >
void mlpack::kernel::LinearKernel::Serialize ( Archive &  ,
const unsigned  int 
)
inline

Serialize the kernel (it has no members... do nothing).

Definition at line 60 of file linear_kernel.hpp.


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