Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00060 #ifndef WARPING_H
00061 #define WARPING_H
00062 #include "mathadd.h"
00063 #include "definitions.h"
00064 #include "time_frequency.h"
00065 #include "regularization.h"
00066 #include "eeg.h"
00067
00068 #ifdef __cplusplus
00069 extern "C" {
00070 #endif
00071
00072
00073
00074
00079 typedef enum {
00080 SLOPE_CONSTRAINT_NONE=0,
00081 SLOPE_CONSTRAINT_LAX,
00082 SLOPE_CONSTRAINT_MEDIUM,
00083 SLOPE_CONSTRAINT_SEVERE
00084 } SlopeConstraint;
00085
00086
00087
00088
00089
00090 typedef struct{
00091 int *t1;
00092 int *t2;
00093 int n1;
00094 int n2;
00095 int n;
00096 } WarpPath;
00097
00098
00111 #define warppath_CHECK( flag, w ) \
00112 if(!( (w)->ndim==2 && (w)->dtype==UINT )){ \
00113 char *dts=""; \
00114 array_DTYPESTRING( dts, w->dtype ); \
00115 errprintf("not a warppath, ndim=%i, dtype=%s\n", w->ndim, dts ); \
00116 flag=FALSE; \
00117 } else { flag=TRUE; }
00118
00119
00120
00121
00122
00123 Array* matrix_dtw_cumulate ( Array *mat, bool alloc, OptArgList *optargs );
00124 Array* matrix_dtw_backtrack ( const Array *d );
00125
00126 Array* dtw_add_signals( const Array *s1, const Array *s2, const Array *path, OptArgList *opts );
00127
00128
00129 EEG* eeg_dtw_hierarchical( EEG *eeg_in, const double **distmatrix,
00130 EEG *out, OptArgList *optargs );
00131
00132 EEG* eeg_gibbons( EEG *eeg, int stimulus_marker, int response_marker, double k );
00133
00134 #ifdef EXPERIMENTAL
00135 Array* multiwarp( Array *in, uint window, OptArgList *opts );
00136 Array* multiwarp_add( Array *in, Array *times, Array *path );
00137 #endif
00138
00139
00141
00142
00143 void dtw_cumulate_matrix ( double **d, int M, int N, OptArgList *opts );
00144
00145 WarpPath* dtw_backtrack ( const double **d, int M, int N, WarpPath *P );
00146
00147 WarpPath* init_warppath ( WarpPath *path, int n1, int n2 );
00148 void free_warppath ( WarpPath *p );
00149 void reset_warppath( WarpPath *P, int n1, int n2 );
00150 void print_warppath( FILE *out, WarpPath *P );
00151
00152 #ifdef __cplusplus
00153 }
00154 #endif
00155
00156 #endif