| 1 |
/** @file hikmeans.h |
| 2 |
** @brief Hierarchical Integer K-Means Clustering |
| 3 |
** @author Brian Fulkerson |
| 4 |
**/ |
| 5 |
|
| 6 |
/* |
| 7 |
Copyright (C) 2007-12 Andrea Vedaldi and Brian Fulkerson. |
| 8 |
All rights reserved. |
| 9 |
|
| 10 |
This file is part of the VLFeat library and is made available under |
| 11 |
the terms of the BSD license (see the COPYING file). |
| 12 |
*/ |
| 13 |
|
| 14 |
#ifndef VL_HIKMEANS_H |
| 15 |
#define VL_HIKMEANS_H |
| 16 |
|
| 17 |
#include "generic.h" |
| 18 |
#include "ikmeans.h" |
| 19 |
|
| 20 |
struct _VLHIKMTree ; |
| 21 |
struct _VLHIKMNode ; |
| 22 |
|
| 23 |
/** @brief HIKM tree node |
| 24 |
** |
| 25 |
** The number of children @a K is not bigger than the @a K parameter |
| 26 |
** of the HIKM tree. |
| 27 |
**/ |
| 28 |
typedef struct _VlHIKMNode |
| 29 |
{ |
| 30 |
VlIKMFilt *filter ; /**< IKM filter for this node*/ |
| 31 |
struct _VlHIKMNode **children ; /**< Node children (if any) */ |
| 32 |
} VlHIKMNode ; |
| 33 |
|
| 34 |
/** @brief HIKM tree */ |
| 35 |
typedef struct _VlHIKMTree { |
| 36 |
vl_size M ; /**< IKM: data dimensionality */ |
| 37 |
vl_size K ; /**< IKM: K */ |
| 38 |
vl_size depth ; /**< Depth of the tree */ |
| 39 |
vl_size max_niters ; /**< IKM: maximum # of iterations */ |
| 40 |
int method ; /**< IKM: method */ |
| 41 |
int verb ; /**< Verbosity level */ |
| 42 |
VlHIKMNode * root; /**< Tree root node */ |
| 43 |
} VlHIKMTree ; |
| 44 |
|
| 45 |
/** @name Create and destroy |
| 46 |
** @{ |
| 47 |
**/ |
| 48 |
VL_EXPORT VlHIKMTree *vl_hikm_new (int method) ; |
| 49 |
VL_EXPORT void vl_hikm_delete (VlHIKMTree *f) ; |
| 50 |
/** @} */ |
| 51 |
|
| 52 |
/** @name Retrieve data and parameters |
| 53 |
** @{ |
| 54 |
**/ |
| 55 |
VL_EXPORT vl_size vl_hikm_get_ndims (VlHIKMTree const *f) ; |
| 56 |
VL_EXPORT vl_size vl_hikm_get_K (VlHIKMTree const *f) ; |
| 57 |
VL_EXPORT vl_size vl_hikm_get_depth (VlHIKMTree const *f) ; |
| 58 |
VL_EXPORT int vl_hikm_get_verbosity (VlHIKMTree const *f) ; |
| 59 |
VL_EXPORT vl_size vl_hikm_get_max_niters (VlHIKMTree const *f) ; |
| 60 |
VL_EXPORT VlHIKMNode const * vl_hikm_get_root (VlHIKMTree const *f) ; |
| 61 |
/** @} */ |
| 62 |
|
| 63 |
/** @name Set parameters |
| 64 |
** @{ |
| 65 |
**/ |
| 66 |
VL_EXPORT void vl_hikm_set_verbosity (VlHIKMTree *f, int verb) ; |
| 67 |
VL_EXPORT void vl_hikm_set_max_niters (VlHIKMTree *f, int max_niters) ; |
| 68 |
/** @} */ |
| 69 |
|
| 70 |
/** @name Process data |
| 71 |
** @{ |
| 72 |
**/ |
| 73 |
VL_EXPORT void vl_hikm_init (VlHIKMTree *f, vl_size M, vl_size K, vl_size depth) ; |
| 74 |
VL_EXPORT void vl_hikm_train (VlHIKMTree *f, vl_uint8 const *data, vl_size N) ; |
| 75 |
VL_EXPORT void vl_hikm_push (VlHIKMTree *f, vl_uint32 *asgn, vl_uint8 const *data, vl_size N) ; |
| 76 |
/** @} */ |
| 77 |
|
| 78 |
|
| 79 |
/* VL_HIKMEANS_H */ |
| 80 |
#endif |