#include "mperfl.h"
#include <math.h>
#include <limits.h>
#include <assert.h>
Functions | |
MPerf* | mperf_ctor (MPerf *mp) |
void | add_key (SSizedKeys *keys, KeyString *key) |
MPerf* | mperf_init (MPerf *mp, KeyString *keys, size_t keyNo) |
void | normalize_probs (SSizedKeys *keys) |
size_t | find_discriminator (SSizedKeys *keys, size_t keyLen) |
int | finalize_node (Node *node, size_t len) |
int | mperf_finish (MPerf *mp) |
KeyString* | mperf_find (MPerf *mp, const char *key, size_t keyLen) |
KeyString* | mperf_search (MPerf *mp, const char *key, size_t keyLen) |
int | for_all_key_nodes (Node *node, int(*fnctn)(KeyString *, void *), void *data) |
int | mperf_for_all (MPerf *mp, int(*fnctn)(KeyString *, void *), void *data) |
|
|
|
|
|
|
|
|
|
Initialize an MPerf. If you pass NULL, memory will be malloc()'ed for an MPerf. |
|
Use this function, I you're 100% sure, that the key will be found in the MPerf. This is fatser than mperf_search(). |
|
Finish an initalized MPerf. After finishing it, you may search it for keys. |
|
Let's you apply the function `fnctn' to all KeyStrings. `data' is passed as the second parameter to `fnctn'. |
|
Set the probabilities, keys and the associated data. After calling this you MPerf won't work, yet. You'll have to call mperf_finish() * first. |
|
Use this function, if it's possible that the key is not in the MPerf. This will take the time for a final memcmp(). |
|
|