---
name: "mlpack_kernel_LinearKernel"
section: "3"
platform: "linux"
package: "mlpack-doc"
version: "1.0.10-1"
release: "Debian 8 (Jessie)"
platforms: ["linux"]
url: "https://new.carta.tech/mlpack_kernel_LinearKernel"
---

# mlpack\_kernel\_LinearKernel(3)

The simple linear kernel (dot product).

## NAME

mlpack::kernel::LinearKernel -

The simple linear kernel (dot product).

## SYNOPSIS

### Public Member Functions

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

### Static Public Member Functions

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

## Detailed Description

The simple linear kernel (dot product).

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

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

Definition at line 42 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 49 of file linear\_kernel.hpp.

## Member Function Documentation

### template\<typename VecType \> static double mlpack::kernel::LinearKernel::Evaluate (const VecType &a, const VecType &b)` [inline]`, ` [static]`

Simple evaluation of the dot product. This evaluation uses Armadillo's dot() function.

**Template Parameters:**

*VecType* Type of vector (should be arma::vec or arma::spvec).

**Parameters:**

*a* First vector. \
 *b* Second vector.

**Returns:**

K(a, b).

Definition at line 61 of file linear\_kernel.hpp.

### std::string mlpack::kernel::LinearKernel::ToString () const` [inline]`

Return a string representation of the kernel.

Definition at line 67 of file linear\_kernel.hpp.

## Author

Generated automatically by Doxygen for MLPACK from the source code.
