de.lmu.ifi.dbs.elki.distance.distancefunction
Class WeightedDistanceFunction

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.distance.distancefunction.AbstractPrimitiveDistanceFunction<NumberVector<?,?>,DoubleDistance>
      extended by de.lmu.ifi.dbs.elki.distance.distancefunction.AbstractVectorDoubleDistanceFunction
          extended by de.lmu.ifi.dbs.elki.distance.distancefunction.WeightedDistanceFunction
All Implemented Interfaces:
DistanceFunction<NumberVector<?,?>,DoubleDistance>, PrimitiveDistanceFunction<NumberVector<?,?>,DoubleDistance>, PrimitiveDoubleDistanceFunction<NumberVector<?,?>>, InspectionUtilFrequentlyScanned, Parameterizable
Direct Known Subclasses:
HSBHistogramQuadraticDistanceFunction, RGBHistogramQuadraticDistanceFunction

public class WeightedDistanceFunction
extends AbstractVectorDoubleDistanceFunction

Provides the Weighted distance for feature vectors.


Field Summary
protected  Matrix weightMatrix
          The weight matrix.
 
Constructor Summary
WeightedDistanceFunction(Matrix weightMatrix)
          Provides the Weighted distance for feature vectors.
 
Method Summary
 double doubleDistance(NumberVector<?,?> o1, NumberVector<?,?> o2)
          Provides the Weighted distance for feature vectors.
 VectorFieldTypeInformation<? super NumberVector<?,?>> getInputTypeRestriction()
          Get the input data type of the function.
 
Methods inherited from class de.lmu.ifi.dbs.elki.distance.distancefunction.AbstractVectorDoubleDistanceFunction
distance, getDistanceFactory
 
Methods inherited from class de.lmu.ifi.dbs.elki.distance.distancefunction.AbstractPrimitiveDistanceFunction
instantiate, isMetric, isSymmetric
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface de.lmu.ifi.dbs.elki.distance.distancefunction.DistanceFunction
instantiate, isMetric, isSymmetric
 

Field Detail

weightMatrix

protected Matrix weightMatrix
The weight matrix.

Constructor Detail

WeightedDistanceFunction

public WeightedDistanceFunction(Matrix weightMatrix)
Provides the Weighted distance for feature vectors.

Parameters:
weightMatrix - weight matrix
Method Detail

doubleDistance

public double doubleDistance(NumberVector<?,?> o1,
                             NumberVector<?,?> o2)
Provides the Weighted distance for feature vectors.

Parameters:
o1 - first Object
o2 - second Object
Returns:
the Weighted distance between the given two vectors

getInputTypeRestriction

public VectorFieldTypeInformation<? super NumberVector<?,?>> getInputTypeRestriction()
Description copied from interface: DistanceFunction
Get the input data type of the function.

Specified by:
getInputTypeRestriction in interface DistanceFunction<NumberVector<?,?>,DoubleDistance>
Specified by:
getInputTypeRestriction in interface PrimitiveDistanceFunction<NumberVector<?,?>,DoubleDistance>
Overrides:
getInputTypeRestriction in class AbstractVectorDoubleDistanceFunction
Returns:
Type restriction

Release 0.4.0 (2011-09-20_1324)