at.tuwien.ifs.somtoolbox.layers.metrics
Class LInfinityMetric

java.lang.Object
  extended by at.tuwien.ifs.somtoolbox.layers.metrics.AbstractMetric
      extended by at.tuwien.ifs.somtoolbox.layers.metrics.LInfinityMetric
All Implemented Interfaces:
DistanceMetric, Comparable<DistanceMetric>

public class LInfinityMetric
extends AbstractMetric
implements DistanceMetric

Implements the L-Infinity metric,defined for two vectors x and y as max( |xi-yi| ), i = 1,...,|x|.

Version:
$Id: LInfinityMetric.java 3358 2010-02-11 14:35:07Z mayer $
Author:
Rudolf Mayer

Nested Class Summary
 
Nested classes/interfaces inherited from interface at.tuwien.ifs.somtoolbox.layers.metrics.DistanceMetric
DistanceMetric.SparcseMetricModes
 
Field Summary
 
Fields inherited from class at.tuwien.ifs.somtoolbox.layers.metrics.AbstractMetric
PACKAGE_NAME
 
Constructor Summary
LInfinityMetric()
           
 
Method Summary
 double distance(double[] vector1, double[] vector2)
          Calculates the distance between two vectors provided by argument vector1 and vector2.
 String toString()
           
 
Methods inherited from class at.tuwien.ifs.somtoolbox.layers.metrics.AbstractMetric
checkDimensions, checkDimensions, compareTo, distance, distance, distance, distance, distance, distance, distance, distance, instantiate, instantiateNice, meanVector, performanceTest, setMetricParams, transformValue, transformVector
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface at.tuwien.ifs.somtoolbox.layers.metrics.DistanceMetric
distance, distance, distance, distance, distance, distance, distance, distance, setMetricParams, transformValue, transformVector
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Constructor Detail

LInfinityMetric

public LInfinityMetric()
Method Detail

distance

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

Specified by:
distance in interface DistanceMetric
Specified by:
distance in class AbstractMetric
Parameters:
vector1 - first vector.
vector2 - second vector.
Returns:
the distance between vector1 and vector2.
Throws:
MetricException - if the dimensionalities of the two vectors differ.
See Also:
DistanceMetric.distance(double[], double[])

toString

public String toString()
Overrides:
toString in class Object