00001
00013 #ifndef FUNCTION
00014 #define FUNCTIONS
00015
00016 #include "db.h"
00017
00027 struct cache_type {
00029 MY_FLOAT fentropy;
00031 MY_FLOAT bentropy;
00033 MY_FLOAT sindex;
00035 MY_FLOAT pindex;
00037 MY_FLOAT squares;
00038 };
00039
00048 void invalidate(cache_type* cache);
00049
00064 void fill_squares(let_stat* where, let_stat* other, ch_key_type type,MY_FLOAT hint=1);
00065
00079 void fill_squares(let_stat* where, void* data);
00080
00082 struct fill_squares_struct {
00083 let_stat* other;
00084 ch_key_type type;
00085 MY_FLOAT hint;
00086 };
00087
00100 MY_FLOAT lalt(const tmpstats* stats,int position);
00101
00114 MY_FLOAT ralt(const tmpstats* stats,int position);
00115
00128 MY_FLOAT trian(const tmpstats* stats,int position);
00129
00154 MY_FLOAT sqrs(const tmpstats* stats,cache_type *cache,int position,MY_FLOAT hint,int m);
00155
00175 MY_FLOAT fsqrs(const tmpstats* stats,int pos,MY_FLOAT hint,int end);
00176
00196 MY_FLOAT bsqrs(const tmpstats* stats,int pos,MY_FLOAT hint,int end);
00197
00212 MY_FLOAT sindex(const tmpstats* stats,cache_type *cache,int position);
00213
00226 MY_FLOAT dtrian(const tmpstats* stats,int position);
00227
00241 MY_FLOAT fentr(const tmpstats* stats,cache_type *cache,int position);
00242
00256 MY_FLOAT bentr(const tmpstats* stats,cache_type *cache,int position);
00257
00271 MY_FLOAT dfentr(const tmpstats* stats,cache_type *cache,int position);
00272
00286 MY_FLOAT dbentr(const tmpstats* stats,cache_type *cache,int position);
00287
00288 #endif