Documentation>C API
Typedefs | Enumerations
homkermap.h File Reference

Homogeneous kernel map (Homogeneous kernel map). More...

`#include "generic.h"`
`#include <math.h>`

## Typedefs

typedef OPAQUE | VlHomogeneousKernelMap
| Homogeneous kernel map object.

## Enumerations

enum | VlHomogeneousKernelType { VlHomogeneousKernelIntersection = 0 , VlHomogeneousKernelChi2 , VlHomogeneousKernelJS }
| Type of kernel. More...
enum | VlHomogeneousKernelMapWindowType { VlHomogeneousKernelMapWindowUniform = 0 , VlHomogeneousKernelMapWindowRectangular = 1 }
| Type of spectral windowing function. More...

## Functions

Create and destroy
VlHomogeneousKernelMap * | vl_homogeneouskernelmap_new (VlHomogeneousKernelType kernelType, double gamma, vl_size order, double period, VlHomogeneousKernelMapWindowType windowType)
| Create a new homgeneous kernel map.
void | vl_homogeneouskernelmap_delete (VlHomogeneousKernelMap *self)
| Delete an object instance.
Process data
void | vl_homogeneouskernelmap_evaluate_d (VlHomogeneousKernelMap const *self, double *destination, vl_size stride, double x)
| Evaluate map.
void | vl_homogeneouskernelmap_evaluate_f (VlHomogeneousKernelMap const *self, float *destination, vl_size stride, double x)
Retrieve data and parameters
vl_size | vl_homogeneouskernelmap_get_order (VlHomogeneousKernelMap const *self)
| Get the map order.
vl_size | vl_homogeneouskernelmap_get_dimension (VlHomogeneousKernelMap const *self)
| Get the map dimension.
VlHomogeneousKernelType | vl_homogeneouskernelmap_get_kernel_type (VlHomogeneousKernelMap const *self)
| Get the kernel type.
VlHomogeneousKernelMapWindowType | vl_homogeneouskernelmap_get_window_type (VlHomogeneousKernelMap const *self)
| Get the window type.

## Detailed Description

Author
  Andrea Vedaldi

## Enumeration Type Documentation

## ◆ VlHomogeneousKernelMapWindowType

enum VlHomogeneousKernelMapWindowType

Enumerator
VlHomogeneousKernelMapWindowUniform | uniform window
VlHomogeneousKernelMapWindowRectangular | rectangular window

## ◆ VlHomogeneousKernelType

enum VlHomogeneousKernelType

Enumerator
VlHomogeneousKernelIntersection | intersection kernel
VlHomogeneousKernelChi2 | Chi2 kernel
VlHomogeneousKernelJS | Jensen-Shannon kernel

## Function Documentation

## ◆ vl_homogeneouskernelmap_delete()

void vl_homogeneouskernelmap_delete | ( | VlHomogeneousKernelMap * | self | ) |

Parameters

  self | object. The function deletes the specified map object.

## ◆ vl_homogeneouskernelmap_evaluate_d()

void vl_homogeneouskernelmap_evaluate_d | ( | VlHomogeneousKernelMap const * | self,
|  | double * | destination,
|  | vl_size | stride,
|  | double | x )

Parameters

  self | map object.
  destination | output buffer.
  stride | stride of the output buffer.
  x | value to expand.

The function evaluates the feature map on x and stores the resulting `2*order+1` dimensional vector to destination[0], destination[stride], destination[2*stride], ....

## ◆ vl_homogeneouskernelmap_evaluate_f()

void vl_homogeneouskernelmap_evaluate_f | ( | VlHomogeneousKernelMap const * | self,
|  | float * | destination,
|  | vl_size | stride,
|  | double | x )

Parameters

  self | map object.
  destination | output buffer.
  stride | stride of the output buffer.
  x | value to expand.

The function evaluates the feature map on x and stores the resulting `2*order+1` dimensional vector to destination[0], destination[stride], destination[2*stride], ....

## ◆ vl_homogeneouskernelmap_get_dimension()

vl_size vl_homogeneouskernelmap_get_dimension | ( | VlHomogeneousKernelMap const * | self | ) |

Parameters

  self | object.

Returns
  the map dimension (2 `order` +1).

## ◆ vl_homogeneouskernelmap_get_kernel_type()

VlHomogeneousKernelType vl_homogeneouskernelmap_get_kernel_type | ( | VlHomogeneousKernelMap const * | self | ) |

Parameters

  self | object.

Returns
  kernel type.

## ◆ vl_homogeneouskernelmap_get_order()

vl_size vl_homogeneouskernelmap_get_order | ( | VlHomogeneousKernelMap const * | self | ) |

Parameters

  self | object.

Returns
  the map order.

## ◆ vl_homogeneouskernelmap_get_window_type()

VlHomogeneousKernelMapWindowType vl_homogeneouskernelmap_get_window_type | ( | VlHomogeneousKernelMap const * | self | ) |

Parameters

  self | object.

Returns
  window type.

## ◆ vl_homogeneouskernelmap_new()

VlHomogeneousKernelMap * vl_homogeneouskernelmap_new | ( | VlHomogeneousKernelType | kernelType,
|  | double | gamma,
|  | vl_size | order,
|  | double | period,
|  | VlHomogeneousKernelMapWindowType | windowType )

Parameters

  kernelType | type of homogeneous kernel.
  gamma | kernel homogeneity degree.
  order | approximation order.
  period | kernel period.
  windowType | type of window used to truncate the kernel.

Returns
  the new homogeneous kernel map.

The function intializes a new homogeneous kernel map for the specified kernel type, homogeneity degree, approximation order, period, and truncation window. See Fundamentals for details.

The homogeneity degree `gamma` must be positive (the standard kernels are obtained by setting `gamma` to 1). When unsure, set `windowType` to VlHomogeneousKernelMapWindowRectangular. The `period` should be non-negative; specifying a negative or null value causes the function to switch to a default value.

The function returns `NULL` if there is not enough free memory.