- Main Page
- Data Structures
- Files
- Related Pages

# ikmeans.h

Go to the documentation of this file.

    00001
    00007 #ifndef VL_IKMEANS_H
    00008 #define VL_IKMEANS_H
    00009
    00010 #include "generic.h"
    00011
    00012 typedef vl_int32 vl_ikm_acc ;
    00013 typedef vl_uint8 vl_ikm_data ;
    00019 enum VlIKMAlgorithms {
    00020   VL_IKM_LLOYD,
    00021   VL_IKM_ELKAN
    00022 } ;
    00023
    00028 typedef struct _VlIKMFilt
    00029 {
    00030   vl_ikm_acc *centers ;
    00031   int M ;
    00032   int K ;
    00034   int method ;
    00035   int max_niters ;
    00036   int verb ;
    00038   vl_ikm_acc *inter_dist ;
    00039 } VlIKMFilt ;
    00040
    00044 VlIKMFilt *vl_ikm_new    (int method) ;
    00045 void       vl_ikm_delete (VlIKMFilt *f) ;
    00051 void vl_ikm_init           (VlIKMFilt *f, vl_ikm_acc const *centers, int M, int K) ;
    00052 void vl_ikm_init_rand      (VlIKMFilt *f, int M, int K) ;
    00053 void vl_ikm_init_rand_data (VlIKMFilt *f, vl_ikm_data const *data, int M, int N, int K) ;
    00054 int  vl_ikm_train          (VlIKMFilt *f, vl_ikm_data const *data, int N) ;
    00055 void vl_ikm_push           (VlIKMFilt *f, vl_uint *asgn, vl_ikm_data const *data, int N) ;
    00056
    00057 vl_uint  vl_ikm_push_one   (vl_ikm_acc const *centers,
    00058                             vl_ikm_data const *data,
    00059                             int M, int K) ;
    00065 VL_INLINE int vl_ikm_get_ndims      (VlIKMFilt const *f) ;
    00066 VL_INLINE int vl_ikm_get_K          (VlIKMFilt const *f) ;
    00067 VL_INLINE int vl_ikm_get_verbosity  (VlIKMFilt const *f) ;
    00068 VL_INLINE int vl_ikm_get_max_niters (VlIKMFilt const *f) ;
    00069 VL_INLINE vl_ikm_acc const * vl_ikm_get_centers (VlIKMFilt const *f) ;
    00075 VL_INLINE void vl_ikm_set_verbosity  (VlIKMFilt *f, int verb) ;
    00076 VL_INLINE void vl_ikm_set_max_niters (VlIKMFilt *f, int max_niters) ;
    00085 VL_INLINE int
    00086 vl_ikm_get_ndims (VlIKMFilt const* f)
    00087 {
    00088   return f-> M ;
    00089 }
    00090
    00097 VL_INLINE int
    00098 vl_ikm_get_K (VlIKMFilt const* f)
    00099 {
    00100   return f-> K ;
    00101 }
    00102
    00109 VL_INLINE int
    00110 vl_ikm_get_verbosity (VlIKMFilt const* f)
    00111 {
    00112   return f-> verb ;
    00113 }
    00114
    00121 VL_INLINE int
    00122 vl_ikm_get_max_niters (VlIKMFilt const* f)
    00123 {
    00124   return f-> max_niters ;
    00125 }
    00126
    00133 VL_INLINE vl_ikm_acc const *
    00134 vl_ikm_get_centers (VlIKMFilt const* f)
    00135 {
    00136   return f-> centers ;
    00137 }
    00138
    00145 VL_INLINE void
    00146 vl_ikm_set_verbosity (VlIKMFilt *f, int verb)
    00147 {
    00148   f-> verb = verb ;
    00149 }
    00150
    00157 VL_INLINE void
    00158 vl_ikm_set_max_niters (VlIKMFilt *f, int max_niters)
    00159 {
    00160   f-> max_niters = max_niters ;
    00161 }
    00162
    00163 /* VL_IKMEANS_H */
    00164 #endif