org.omegahat.GUtilities
Class Distance

java.lang.Object
  |
  +--org.omegahat.GUtilities.Distance

public class Distance
extends java.lang.Object


Field Summary
(package private) static Jama.Matrix cachedCovMat
           
(package private) static Jama.Matrix cachedInverse
           
(package private) static int cacheIndex
           
(package private) static int cacheLength
           
(package private) static double[][][] covKey
           
(package private) static Jama.Matrix[] invCache
           
(package private) static Jama.Matrix[] matCache
           
 
Constructor Summary
Distance()
           
 
Method Summary
protected static void cacheCov(double[][] cov)
           
static double euclidean_2(double[] x, double[] y)
          squared euclidean distance
static double euclidean(double[] x, double[] y)
          euclidean distance
static double mahalanobis_2(double[] x, double[] y, double[][] cov)
          squared Mahalanobis distance
static double mahalanobis(double[] x, double[] y, double[][] cov)
          Mahalanobis distance
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

cachedCovMat

static Jama.Matrix cachedCovMat

cachedInverse

static Jama.Matrix cachedInverse

cacheLength

static int cacheLength

cacheIndex

static int cacheIndex

covKey

static double[][][] covKey

matCache

static Jama.Matrix[] matCache

invCache

static Jama.Matrix[] invCache
Constructor Detail

Distance

public Distance()
Method Detail

cacheCov

protected static void cacheCov(double[][] cov)

mahalanobis_2

public static double mahalanobis_2(double[] x,
                                   double[] y,
                                   double[][] cov)
squared Mahalanobis distance

mahalanobis

public static double mahalanobis(double[] x,
                                 double[] y,
                                 double[][] cov)
Mahalanobis distance

euclidean_2

public static double euclidean_2(double[] x,
                                 double[] y)
squared euclidean distance

euclidean

public static double euclidean(double[] x,
                               double[] y)
euclidean distance