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

java.lang.Object
  extended by at.tuwien.ifs.somtoolbox.layers.metrics.AbstractMetric
      extended by at.tuwien.ifs.somtoolbox.layers.metrics.AbstractWeightedMetric
All Implemented Interfaces:
DistanceMetric, Comparable<DistanceMetric>
Direct Known Subclasses:
L2MetricWeighted

public abstract class AbstractWeightedMetric
extends AbstractMetric

Version:
$Id: AbstractWeightedMetric.java 3583 2010-05-21 10:07:41Z mayer $
Author:
Rudolf Mayer

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

Field Detail

featureWeights

protected double[] featureWeights
Constructor Detail

AbstractWeightedMetric

public AbstractWeightedMetric()
Method Detail

instantiate

public static AbstractWeightedMetric instantiate(String mName)
                                          throws ClassNotFoundException,
                                                 InstantiationException,
                                                 IllegalAccessException
Throws:
ClassNotFoundException
InstantiationException
IllegalAccessException

distance

public abstract double distance(double[] vector1,
                                double[] vector2,
                                double[] weights)
                         throws MetricException
Throws:
MetricException

distance

public double distance(double[] vector,
                       Unit unit)
                throws MetricException
Throws:
MetricException

distance

public double distance(InputDatum inputDatum,
                       Unit unit)
                throws MetricException
Throws:
MetricException

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[])