00001 #ifndef _EMD_H_
00002 #define _EMD_H_
00003
00004 #include <stdio.h>
00005 #include <math.h>
00006 #define MAX_SIG_SIZE 1000
00007 #define MAX_ITERATIONS 500
00008 #define INFINITY 1e20
00009 #define EPSILON 1e-20
00010
00011
00012 #include <newmat.h>
00013 typedef ColumnVector * feature_t;
00014
00015
00016
00017 typedef struct
00018 {
00019 int n;
00020 feature_t *Features;
00021 double *Weights;
00022 } signature_t;
00023
00024
00025 typedef struct
00026 {
00027 int from;
00028 int to;
00029 double amount;
00030 } flow_t;
00031
00032
00033
00034 double emd(signature_t *Signature1, signature_t *Signature2,
00035 float (*func)(feature_t *, feature_t *),
00036 flow_t *Flow, int *FlowSize);
00037
00038 #endif