---
name: "mlpack_kernel_SphericalKernel"
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_SphericalKernel"
---

# mlpack\_kernel\_SphericalKernel(3)

## NAME

mlpack::kernel::SphericalKernel -

## SYNOPSIS

### Public Member Functions

**SphericalKernel** ()\
 **SphericalKernel** (double b)\
 template\<typename VecType \> double **ConvolutionIntegral** (const VecType &a, const VecType &b)\
 *Obtains the convolution integral \[integral K(\|\|x-a\|\|)K(\|\|b-x\|\|)dx\] for the two vectors.*  template\<typename VecType \> double **Evaluate** (const VecType &a, const VecType &b)\
 double **Evaluate** (double t)\
 double **Normalizer** (size\_t dimension)\
 std::string **ToString** () const \
 *Return a string representation of the kernel.*

### Private Attributes

double **bandwidth**\
 double **bandwidthSquared**\

## Detailed Description

Definition at line 32 of file spherical\_kernel.hpp.

## Constructor & Destructor Documentation

### mlpack::kernel::SphericalKernel::SphericalKernel ()` [inline]`

Definition at line 35 of file spherical\_kernel.hpp.

### mlpack::kernel::SphericalKernel::SphericalKernel (doubleb)` [inline]`

Definition at line 38 of file spherical\_kernel.hpp.

## Member Function Documentation

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

Obtains the convolution integral \[integral K(\|\|x-a\|\|)K(\|\|b-x\|\|)dx\] for the two vectors. In this case, because our simple example kernel has no internal parameters, we can declare the function static. For a more complex example which cannot be declared static, see the **GaussianKernel**, which stores an internal parameter.

**Template Parameters:**

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

**Parameters:**

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

**Returns:**

the convolution integral value.

Definition at line 62 of file spherical\_kernel.hpp.

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

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

Definition at line 43 of file spherical\_kernel.hpp.

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

### double mlpack::kernel::SphericalKernel::Evaluate (doublet)` [inline]`

Definition at line 93 of file spherical\_kernel.hpp.

References bandwidth.

### double mlpack::kernel::SphericalKernel::Normalizer (size\_tdimension)` [inline]`

Definition at line 88 of file spherical\_kernel.hpp.

References bandwidth, and M\_PI.

Referenced by ConvolutionIntegral().

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

Return a string representation of the kernel.

Definition at line 99 of file spherical\_kernel.hpp.

References bandwidth.

## Member Data Documentation

### double mlpack::kernel::SphericalKernel::bandwidth` [private]`

Definition at line 108 of file spherical\_kernel.hpp.

Referenced by ConvolutionIntegral(), Evaluate(), Normalizer(), and ToString().

### double mlpack::kernel::SphericalKernel::bandwidthSquared` [private]`

Definition at line 109 of file spherical\_kernel.hpp.

Referenced by Evaluate().

## Author

Generated automatically by Doxygen for MLPACK from the source code.
