Documentation - C API
hikmeans.c File Reference

Hierarchical Integer K-Means Clustering - Declaration. More...

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include "hikmeans.h"

Functions

vl_uint8vl_hikm_copy_subset (vl_uint8 const *data, vl_uint *ids, int N, int M, vl_uint id, int *N2)
 Copy a subset of the data to a buffer.
static VlHIKMNodexmeans (VlHIKMTree *tree, vl_uint8 const *data, int N, int K, int height)
 Compute HIKM clustering.
static void xdelete (VlHIKMNode *node)
 Delete node.
VlHIKMTreevl_hikm_new (int method)
 New HIKM tree.
void vl_hikm_delete (VlHIKMTree *f)
 Delete HIKM tree.
void vl_hikm_init (VlHIKMTree *f, int M, int K, int depth)
 Initialize HIKM tree.
void vl_hikm_train (VlHIKMTree *f, vl_uint8 const *data, int N)
 Train HIKM tree.
void vl_hikm_push (VlHIKMTree *f, vl_uint *asgn, vl_uint8 const *data, int N)
 Project data down HIKM tree.

Detailed Description

Author:
Brian Fulkerson
Andrea Vedaldi

Function Documentation

vl_uint8* vl_hikm_copy_subset ( vl_uint8 const *  data,
vl_uint ids,
int  N,
int  M,
vl_uint  id,
int *  N2 
)
Parameters:
dataData
idsData labels
NNumber of indices
MData dimensionality
idLabel of data to copy
N2Number of data copied (out)
Returns:
a new buffer with a copy of the selected data.
void vl_hikm_delete ( VlHIKMTree f)
Parameters:
fHIKM tree.
void vl_hikm_init ( VlHIKMTree f,
int  M,
int  K,
int  depth 
)
Parameters:
fHIKM tree.
MData dimensionality.
KNumber of clusters per node.
depthTree depth.
Remarks:
depth cannot be smaller than 1.
Returns:
a new HIKM tree representing the clustering.
VlHIKMTree* vl_hikm_new ( int  method)
Parameters:
methodclustering method.
Returns:
new HIKM tree.
void vl_hikm_push ( VlHIKMTree f,
vl_uint asgn,
vl_uint8 const *  data,
int  N 
)
Parameters:
fHIKM tree.
asgnPath down the tree (out).
dataData to project.
NNumber of data.

The function writes to asgn the path of the data data down the HIKM tree f. The parameter asgn must point to an array of M by N elements, where M is the depth of the HIKM tree and N is the number of data point to process.

void vl_hikm_train ( VlHIKMTree f,
vl_uint8 const *  data,
int  N 
)
Parameters:
fHIKM tree.
dataData to cluster.
NNumber of data.
static void xdelete ( VlHIKMNode node)
static
Parameters:
nodeto delete.

The function deletes recursively node and all its descendent.

static VlHIKMNode* xmeans ( VlHIKMTree tree,
vl_uint8 const *  data,
int  N,
int  K,
int  height 
)
static
Parameters:
treeHIKM tree to initialize.
dataData to cluster.
NNumber of data points.
KNumber of clusters for this node.
heightTree height.
Remarks:
height cannot be smaller than 1.
Returns:
a new HIKM node representing a sub-clustering.