at.tuwien.ifs.somtoolbox.layers.metrics
Interface DistanceMetric

All Superinterfaces:
Comparable<DistanceMetric>
All Known Implementing Classes:
AbstractMetric, AbstractWeightedMetric, CosineMetric, L1Metric, L2Metric, L2MetricFast, L2MetricSparse, L2MetricWeighted, LInfinityMetric, LnAlphaMetric, LnMetric, MahalanobisMetric, MissingValueMetricWrapper, MnemonicSOMMetric

public interface DistanceMetric
extends Comparable<DistanceMetric>

The interface, distance metric classes have to implement.

Version:
$Id: DistanceMetric.java 3743 2010-08-06 15:37:15Z mayer $
Author:
Michael Dittenbach, Rudolf Mayer

Nested Class Summary
static class DistanceMetric.SparcseMetricModes
           
 
Method Summary
 double distance(double[] vector1, double[] vector2)
          Calculates the distance between two vectors provided by argument vector1 and vector2.
 double distance(double[] vector1, cern.colt.matrix.DoubleMatrix1D vector2)
          Calculates the distance between two vectors provided by argument vector1 and vector2.
 double distance(double[] vector, InputDatum datum)
          Calculates the distance between two vectors provided by argument vector and datum.
 double distance(cern.colt.matrix.DoubleMatrix1D vector1, double[] vector2)
          Calculates the distance between two vectors provided by argument vector1 and vector2.
 double distance(cern.colt.matrix.DoubleMatrix1D vector1, cern.colt.matrix.DoubleMatrix1D vector2)
          Calculates the distance between two vectors provided by argument vector1 and vector2.
 double distance(cern.colt.matrix.DoubleMatrix1D vector, InputDatum datum)
          Calculates the distance between two vectors provided by argument vector and datum.
 double distance(InputDatum datum, double[] vector)
          Calculates the distance between two vectors provided by argument datum and vector.
 double distance(InputDatum datum, cern.colt.matrix.DoubleMatrix1D vector)
          Calculates the distance between two vectors provided by argument datum and vector.
 double distance(InputDatum datum, InputDatum datum2)
          Calculates the distance between two vectors provided by argument datum and datum2.
 void setMetricParams(String metricParamString)
          Sets additional parameters needed for the metric.
 double transformValue(double value)
           
 double[] transformVector(double[] vector)
           
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Method Detail

distance

double distance(double[] vector1,
                double[] vector2)
                throws MetricException
Calculates the distance between two vectors provided by argument vector1 and vector2. A MetricException is thrown, if the dimensionalities of the two vectors differ.

Parameters:
vector1 - first vector.
vector2 - second vector.
Returns:
the distance between vector1 and vector2.
Throws:
MetricException - if the dimensionalities of the two vectors differ.

distance

double distance(double[] vector1,
                cern.colt.matrix.DoubleMatrix1D vector2)
                throws MetricException
Calculates the distance between two vectors provided by argument vector1 and vector2. A MetricException is thrown, if the dimensionalities of the two vectors differ.

Parameters:
vector1 - first vector.
vector2 - second vector.
Returns:
the distance between vector1 and vector2.
Throws:
MetricException - if the dimensionalities of the two vectors differ.

distance

double distance(double[] vector,
                InputDatum datum)
                throws MetricException
Calculates the distance between two vectors provided by argument vector and datum. A MetricException is thrown, if the dimensionalities of the two vectors differ.

Parameters:
vector - first vector.
datum - input datum.
Returns:
the distance between vector and datum.
Throws:
MetricException - if the dimensionalities of the two vectors differ.

distance

double distance(cern.colt.matrix.DoubleMatrix1D vector1,
                double[] vector2)
                throws MetricException
Calculates the distance between two vectors provided by argument vector1 and vector2. A MetricException is thrown, if the dimensionalities of the two vectors differ.

Parameters:
vector1 - first vector.
vector2 - second vector.
Returns:
the distance between vector1 and vector2.
Throws:
MetricException - if the dimensionalities of the two vectors differ.

distance

double distance(cern.colt.matrix.DoubleMatrix1D vector1,
                cern.colt.matrix.DoubleMatrix1D vector2)
                throws MetricException
Calculates the distance between two vectors provided by argument vector1 and vector2. A MetricException is thrown, if the dimensionalities of the two vectors differ.

Parameters:
vector1 - first vector.
vector2 - second vector.
Returns:
the distance between vector1 and vector2.
Throws:
MetricException - if the dimensionalities of the two vectors differ.

distance

double distance(cern.colt.matrix.DoubleMatrix1D vector,
                InputDatum datum)
                throws MetricException
Calculates the distance between two vectors provided by argument vector and datum. A MetricException is thrown, if the dimensionalities of the two vectors differ.

Parameters:
vector - first vector.
datum - input datum.
Returns:
the distance between vector and datum.
Throws:
MetricException - if the dimensionalities of the two vectors differ.

distance

double distance(InputDatum datum,
                double[] vector)
                throws MetricException
Calculates the distance between two vectors provided by argument datum and vector. A MetricException is thrown, if the dimensionalities of the two vectors differ.

Parameters:
datum - input datum.
vector - first vector.
Returns:
the distance between datum and vector.
Throws:
MetricException - if the dimensionalities of the two vectors differ.

distance

double distance(InputDatum datum,
                cern.colt.matrix.DoubleMatrix1D vector)
                throws MetricException
Calculates the distance between two vectors provided by argument datum and vector. A MetricException is thrown, if the dimensionalities of the two vectors differ.

Parameters:
datum - input datum.
vector - first vector.
Returns:
the distance between datum and vector.
Throws:
MetricException - if the dimensionalities of the two vectors differ.

distance

double distance(InputDatum datum,
                InputDatum datum2)
                throws MetricException
Calculates the distance between two vectors provided by argument datum and datum2. A MetricException is thrown, if the dimensionalities of the two vectors differ.

Parameters:
datum - first input datum.
datum2 - second input datum.
Returns:
the distance between datum and vector.
Throws:
MetricException - if the dimensionalities of the two vectors differ.

transformValue

double transformValue(double value)

transformVector

double[] transformVector(double[] vector)

setMetricParams

void setMetricParams(String metricParamString)
                     throws SOMToolboxException
Sets additional parameters needed for the metric. The format of the parameter string is unspecified and depends on the specific sub-class.

Throws:
SOMToolboxException