Documentation - C API
svmdataset.c File Reference

SVM Dataset - Definition. More...

#include "svmdataset.h"
#include <string.h>
#include <math.h>
#include "svmdataset.c"
#include "float.th"

Functions

VlSvmDatasetvl_svmdataset_new (vl_type dataType, void *data, vl_size dimension, vl_size numData)
 Create a new object wrapping a dataset.
void vl_svmdataset_delete (VlSvmDataset *self)
 Delete the object.
void * vl_svmdataset_get_data (VlSvmDataset const *self)
 Get the wrapped data.
vl_size vl_svmdataset_get_num_data (VlSvmDataset const *self)
 Get the number of wrapped data elements.
vl_size vl_svmdataset_get_dimension (VlSvmDataset const *self)
 Get the dimension of the wrapped data.
VlHomogeneousKernelMapvl_svmdataset_get_homogeneous_kernel_map (VlSvmDataset const *self)
 Get the homogeneous kernel map object.
void vl_svmdataset_set_homogeneous_kernel_map (VlSvmDataset *self, VlHomogeneousKernelMap *hom)
 Set the homogeneous kernel map object.
VlSvmAccumulateFunction vl_svmdataset_get_accumulate_function (VlSvmDataset const *self)
 Get the accumulate function.
VlSvmInnerProductFunction vl_svmdataset_get_inner_product_function (VlSvmDataset const *self)
 Get the inner product function.

Detailed Description

Author:
Daniele Perrone
Andrea Vedaldi

Function Documentation

void vl_svmdataset_delete ( VlSvmDataset self)
Parameters:
selfobject to delete.

The function frees the resources allocated by vl_svmdataset_new(). Notice that the wrapped data will not be freed as it is not owned by the object.

VlSvmAccumulateFunction vl_svmdataset_get_accumulate_function ( VlSvmDataset const *  self)
Parameters:
selfobject.
Returns:
a pointer to the accumulate function to use with this data.
void* vl_svmdataset_get_data ( VlSvmDataset const *  self)
Parameters:
selfobject.
Returns:
a pointer to the wrapped data.
vl_size vl_svmdataset_get_dimension ( VlSvmDataset const *  self)
Parameters:
selfobject.
Returns:
dimension of the wrapped data.
VlHomogeneousKernelMap* vl_svmdataset_get_homogeneous_kernel_map ( VlSvmDataset const *  self)
Parameters:
selfobject.
Returns:
homogenoeus kernel map object (or NULL if any).
VlSvmInnerProductFunction vl_svmdataset_get_inner_product_function ( VlSvmDataset const *  self)
Parameters:
selfobject.
Returns:
a pointer to the inner product function to use with this data.
vl_size vl_svmdataset_get_num_data ( VlSvmDataset const *  self)
Parameters:
selfobject.
Returns:
number of wrapped data elements.
VlSvmDataset* vl_svmdataset_new ( vl_type  dataType,
void *  data,
vl_size  dimension,
vl_size  numData 
)
Parameters:
dataTypeof data (float and double supported).
datapointer to the data.
dimensionthe dimension of a data vector.
numDatanumber of wrapped data vectors.
Returns:
new object.

The function allocates and returns a new SVM dataset object wrapping the data pointed by data. Note that no copy is made of data, so the caller should keep the data allocated as the object exists.

See also:
vl_svmdataset_delete
void vl_svmdataset_set_homogeneous_kernel_map ( VlSvmDataset self,
VlHomogeneousKernelMap hom 
)
Parameters:
selfobject.
homhomogeneous kernel map object to use.

After changing the kernel map, the inner product and accumulator function should be queried again (vl_svmdataset_get_inner_product_function adn vl_svmdataset_get_accumulate_function).

Set this to NULL to avoid using a kernel map.

Note that this does not transfer the ownership of the object to the function. Furthermore, VlSvmDataset holds to the object until it is destroyed or the object is replaced or removed by calling this function again.