00001
00005 #ifndef VL_HIKMEANS_H
00006 #define VL_HIKMEANS_H
00007
00008 #include "generic.h"
00009 #include "ikmeans.h"
00010
00011 struct _VLHIKMTree ;
00012 struct _VLHIKMNode ;
00013
00019 typedef struct _VlHIKMNode
00020 {
00021 VlIKMFilt *filter ;
00022 struct _VlHIKMNode **children ;
00023 } VlHIKMNode ;
00024
00026 typedef struct _VlHIKMTree {
00027 int M ;
00028 int K ;
00029 int max_niters ;
00030 int method ;
00031 int verb ;
00033 int depth ;
00034 VlHIKMNode * root;
00035 } VlHIKMTree ;
00036
00040 VlHIKMTree *vl_hikm_new (int method) ;
00041 void vl_hikm_delete (VlHIKMTree *f) ;
00047 VL_INLINE int vl_hikm_get_ndims (VlHIKMTree const *f) ;
00048 VL_INLINE int vl_hikm_get_K (VlHIKMTree const *f) ;
00049 VL_INLINE int vl_hikm_get_depth (VlHIKMTree const *f) ;
00050 VL_INLINE int vl_hikm_get_verbosity (VlHIKMTree const *f) ;
00051 VL_INLINE int vl_hikm_get_max_niters (VlHIKMTree const *f) ;
00052 VL_INLINE VlHIKMNode const * vl_hikm_get_root (VlHIKMTree const *f) ;
00058 VL_INLINE void vl_hikm_set_verbosity (VlHIKMTree *f, int verb) ;
00059 VL_INLINE void vl_hikm_set_max_niters (VlHIKMTree *f, int max_niters) ;
00065 void vl_hikm_init (VlHIKMTree *f, int M, int K, int depth) ;
00066 void vl_hikm_train (VlHIKMTree *f, vl_ikm_data const *data, int N) ;
00067 void vl_hikm_push (VlHIKMTree *f, vl_uint *asgn, vl_ikm_data const *data, int N) ;
00076 VL_INLINE int
00077 vl_hikm_get_ndims (VlHIKMTree const* f)
00078 {
00079 return f-> M ;
00080 }
00081
00088 VL_INLINE int
00089 vl_hikm_get_K (VlHIKMTree const* f)
00090 {
00091 return f-> K ;
00092 }
00093
00100 VL_INLINE int
00101 vl_hikm_get_depth (VlHIKMTree const* f)
00102 {
00103 return f-> depth ;
00104 }
00105
00106
00113 VL_INLINE int
00114 vl_hikm_get_verbosity (VlHIKMTree const* f)
00115 {
00116 return f-> verb ;
00117 }
00118
00125 VL_INLINE int
00126 vl_hikm_get_max_niters (VlHIKMTree const* f)
00127 {
00128 return f-> max_niters ;
00129 }
00130
00137 VL_INLINE VlHIKMNode const *
00138 vl_hikm_get_root (VlHIKMTree const* f)
00139 {
00140 return f-> root ;
00141 }
00142
00149 VL_INLINE void
00150 vl_hikm_set_verbosity (VlHIKMTree *f, int verb)
00151 {
00152 f-> verb = verb ;
00153 }
00154
00161 VL_INLINE void
00162 vl_hikm_set_max_niters (VlHIKMTree *f, int max_niters)
00163 {
00164 f-> max_niters = max_niters ;
00165 }
00166
00167
00168 #endif