diff options
Diffstat (limited to 'mbest.h')
-rw-r--r-- | mbest.h | 23 |
1 files changed, 10 insertions, 13 deletions
@@ -33,27 +33,24 @@ | |||
33 | #define MBEST_STAGES 4 | 33 | #define MBEST_STAGES 4 |
34 | 34 | ||
35 | struct MBEST_LIST { | 35 | struct MBEST_LIST { |
36 | int index[MBEST_STAGES]; /* index of each stage that lead us to this error */ | 36 | int index[MBEST_STAGES]; /* index of each stage that lead us to this error */ |
37 | float error; | 37 | float error; |
38 | }; | 38 | }; |
39 | 39 | ||
40 | struct MBEST { | 40 | struct MBEST { |
41 | int entries; /* number of entries in mbest list */ | 41 | int entries; /* number of entries in mbest list */ |
42 | struct MBEST_LIST *list; | 42 | struct MBEST_LIST *list; |
43 | }; | 43 | }; |
44 | 44 | ||
45 | struct MBEST *mbest_create(int entries); | 45 | struct MBEST *mbest_create(int entries); |
46 | void mbest_destroy(struct MBEST *mbest); | 46 | void mbest_destroy(struct MBEST *mbest); |
47 | void mbest_precompute_weight(float cb[], float w[], int k, int m); | ||
47 | void mbest_insert(struct MBEST *mbest, int index[], float error); | 48 | void mbest_insert(struct MBEST *mbest, int index[], float error); |
48 | void mbest_search(const float *cb, float vec[], float w[], int k, int m, struct MBEST *mbest, int index[]); | 49 | void mbest_search(const float *cb, float vec[], int k, int m, |
49 | void mbest_search450(const float *cb, float vec[], float w[], int k,int shorterK, int m, struct MBEST *mbest, int index[]); | 50 | struct MBEST *mbest, int index[]); |
50 | 51 | void mbest_search450(const float *cb, float vec[], float w[], int k, | |
51 | // #define MBEST_PRINT_OUT | 52 | int shorterK, int m, struct MBEST *mbest, int index[]); |
52 | #ifdef MBEST_PRINT_OUT | ||
53 | #define MBEST_PRINT(a,b) mbest_print((a),(b)) | ||
54 | #else | ||
55 | #define MBEST_PRINT(a,b) | ||
56 | #endif | ||
57 | 53 | ||
54 | void mbest_print(char title[], struct MBEST *mbest); | ||
58 | 55 | ||
59 | #endif | 56 | #endif |