public class DTW extends NamedWarpScriptFunction implements WarpScriptStackFunction
| Modifier and Type | Class and Description |
|---|---|
static interface |
DTW.DTWDistance |
| Modifier and Type | Field and Description |
|---|---|
static int |
ELEVATIONS |
static int |
LOCATIONS |
static int |
TIMESTAMPS |
static int |
VALUES |
| Constructor and Description |
|---|
DTW(java.lang.String name,
boolean normalize,
boolean znormalize) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
apply(WarpScriptStack stack) |
static double |
compute(double[][] values1,
int offset1,
int len1,
double[][] values2,
int offset2,
int len2,
int window,
double threshold,
DTW.DTWDistance distance)
Compute the DTW pseudo-distance on two multi-dimensional data.
|
double |
compute(GeoTimeSerie gts1,
GeoTimeSerie gts2,
int window,
double threshold,
int type,
DTW.DTWDistance distance)
Compute the DTW pseudo-distance on two GTS.
|
static double |
euclidean(double[][] values1,
int index1,
double[][] values2,
int index2) |
static double |
loxodromic(double[][] values1,
int index1,
double[][] values2,
int index2) |
static double |
manhattan(double[][] values1,
int index1,
double[][] values2,
int index2) |
static double |
orthodromic(double[][] values1,
int index1,
double[][] values2,
int index2) |
static double |
squaredEuclidean(double[][] values1,
int index1,
double[][] values2,
int index2) |
getName, refSnapshot, setName, toStringpublic static final int TIMESTAMPS
public static final int LOCATIONS
public static final int ELEVATIONS
public static final int VALUES
public java.lang.Object apply(WarpScriptStack stack) throws WarpScriptException
apply in interface WarpScriptStackFunctionWarpScriptExceptionpublic final double compute(GeoTimeSerie gts1, GeoTimeSerie gts2, int window, double threshold, int type, DTW.DTWDistance distance) throws WarpScriptException
gts1 - One of the two GTSs to compare to the other.gts2 - One of the two GTSs to compare to the other.window - The window defining th maximum index difference when matching the GTSs. Integer.MAX_VALUE for no window constraint.threshold - The maximum value of DTW. If the computed pseudo-distance is over this value, it is aborted and returns -1;type - The characteristic of the GTSs to run the DTW on.distance - The distance to use to compare GTS values.WarpScriptException - in case the DTW cannot be computed given the parameters.public static double compute(double[][] values1,
int offset1,
int len1,
double[][] values2,
int offset2,
int len2,
int window,
double threshold,
DTW.DTWDistance distance)
throws WarpScriptException
values1 - One of the two series to compare to the other. First index is the dimension, second is the element index. This way, less arrays are allocated because usually dimensions << number of elements.offset1 - The start index from which to consider the data in values1.len1 - Number of elements to consider in values1.values2 - One of the two series to compare to the other. First index is the dimension, second is the element index.offset2 - The start index from which to consider the data in values2.len2 - Number of elements to consider in values2.window - The window defining th maximum index difference when matching the data. Integer.MAX_VALUE for no window constraint.threshold - The maximum value of DTW. If the computed pseudo-distance is over this value, it is aborted and returns -1;distance - The distance to use to compare GTS values.WarpScriptException - in case the DTW cannot be computed given the parameters.public static double manhattan(double[][] values1,
int index1,
double[][] values2,
int index2)
throws WarpScriptException
WarpScriptExceptionpublic static double euclidean(double[][] values1,
int index1,
double[][] values2,
int index2)
throws WarpScriptException
WarpScriptExceptionpublic static double squaredEuclidean(double[][] values1,
int index1,
double[][] values2,
int index2)
throws WarpScriptException
WarpScriptExceptionpublic static double loxodromic(double[][] values1,
int index1,
double[][] values2,
int index2)
throws WarpScriptException
WarpScriptExceptionpublic static double orthodromic(double[][] values1,
int index1,
double[][] values2,
int index2)
throws WarpScriptException
WarpScriptException