Go to the documentation of this file.00001
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef VL_IKMEANS_H
00017 #define VL_IKMEANS_H
00018
00019 #include "generic.h"
00020 #include "random.h"
00021
00022 #if 0
00023 typedef vl_int64 vl_ikmacc_t ;
00024 #define VL_IKMACC_MAX 0x7fffffffffffffffULL
00025 #else
00026 typedef vl_int32 vl_ikmacc_t ;
00027 #define VL_IKMACC_MAX 0x7fffffffUL
00028 #endif
00029
00030
00035 enum VlIKMAlgorithms {
00036 VL_IKM_LLOYD,
00037 VL_IKM_ELKAN,
00038 } ;
00039
00044 typedef struct _VlIKMFilt
00045 {
00046 vl_size M ;
00047 vl_size K ;
00048 vl_size max_niters ;
00049 int method ;
00050 int verb ;
00051 vl_ikmacc_t *centers ;
00052 vl_ikmacc_t *inter_dist ;
00053 } VlIKMFilt ;
00054
00057 VL_EXPORT VlIKMFilt *vl_ikm_new (int method) ;
00058 VL_EXPORT void vl_ikm_delete (VlIKMFilt *f) ;
00063 VL_EXPORT void vl_ikm_init (VlIKMFilt *f, vl_ikmacc_t const *centers, vl_size M, vl_size K) ;
00064 VL_EXPORT void vl_ikm_init_rand (VlIKMFilt *f, vl_size M, vl_size K) ;
00065 VL_EXPORT void vl_ikm_init_rand_data (VlIKMFilt *f, vl_uint8 const *data, vl_size M, vl_size N, vl_size K) ;
00066 VL_EXPORT int vl_ikm_train (VlIKMFilt *f, vl_uint8 const *data, vl_size N) ;
00067 VL_EXPORT void vl_ikm_push (VlIKMFilt *f, vl_uint32 *asgn, vl_uint8 const *data, vl_size N) ;
00068 VL_EXPORT vl_uint vl_ikm_push_one (vl_ikmacc_t const *centers, vl_uint8 const *data, vl_size M, vl_size K) ;
00073 VL_EXPORT vl_size vl_ikm_get_ndims (VlIKMFilt const *f) ;
00074 VL_EXPORT vl_size vl_ikm_get_K (VlIKMFilt const *f) ;
00075 VL_EXPORT int vl_ikm_get_verbosity (VlIKMFilt const *f) ;
00076 VL_EXPORT vl_size vl_ikm_get_max_niters (VlIKMFilt const *f) ;
00077 VL_EXPORT vl_ikmacc_t const *vl_ikm_get_centers (VlIKMFilt const *f) ;
00082 VL_EXPORT void vl_ikm_set_verbosity (VlIKMFilt *f, int verb) ;
00083 VL_EXPORT void vl_ikm_set_max_niters (VlIKMFilt *f, vl_size max_niters) ;
00086
00087 #endif