de.lmu.ifi.dbs.elki.distance.distancefunction
Class LocallyWeightedDistanceFunction<O extends RealVector<O,?>,P extends Preprocessor<O>>
java.lang.Object
de.lmu.ifi.dbs.elki.logging.AbstractLoggable
de.lmu.ifi.dbs.elki.utilities.optionhandling.AbstractParameterizable
de.lmu.ifi.dbs.elki.distance.AbstractMeasurementFunction<O,D>
de.lmu.ifi.dbs.elki.distance.distancefunction.AbstractDistanceFunction<O,DoubleDistance>
de.lmu.ifi.dbs.elki.distance.distancefunction.AbstractDoubleDistanceFunction<O>
de.lmu.ifi.dbs.elki.distance.distancefunction.AbstractLocallyWeightedDistanceFunction<O,P>
de.lmu.ifi.dbs.elki.distance.distancefunction.LocallyWeightedDistanceFunction<O,P>
- All Implemented Interfaces:
- DistanceFunction<O,DoubleDistance>, MeasurementFunction<O,DoubleDistance>, SpatialDistanceFunction<O,DoubleDistance>, Loggable, Parameterizable
public class LocallyWeightedDistanceFunction<O extends RealVector<O,?>,P extends Preprocessor<O>>
- extends AbstractLocallyWeightedDistanceFunction<O,P>
- implements SpatialDistanceFunction<O,DoubleDistance>
Provides a locally weighted distance function.
Computes the quadratic form distance between two vectors P and Q as follows:
result = max{distP(P,Q), distQ(Q,P)}
where distX(X,Y) = (X-Y)*MX*(X-Y)T
and MX is the weight matrix of vector X.
- Author:
- Arthur Zimek
Methods inherited from class de.lmu.ifi.dbs.elki.utilities.optionhandling.AbstractParameterizable |
addOption, checkGlobalParameterConstraints, deleteOption, description, description, getParameters, getParameterValue, getPossibleOptions, inlineDescription, isSet, setParameters |
Methods inherited from class de.lmu.ifi.dbs.elki.logging.AbstractLoggable |
debugFine, debugFiner, debugFinest, exception, message, progress, progress, progress, verbose, verbose, warning |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LocallyWeightedDistanceFunction
public LocallyWeightedDistanceFunction()
- Provides a locally weighted distance function.
distance
public DoubleDistance distance(O o1,
O o2)
- Computes the distance between two given real vectors according to this
distance function.
- Specified by:
distance
in interface DistanceFunction<O extends RealVector<O,?>,DoubleDistance>
- Parameters:
o1
- first RealVectoro2
- second RealVector
- Returns:
- the distance between two given real vectors according to this
distance function
minDist
public DoubleDistance minDist(HyperBoundingBox mbr,
O o)
- Computes the minimum distance between the given MBR and the RealVector
object according to this distance function.
- Specified by:
minDist
in interface SpatialDistanceFunction<O extends RealVector<O,?>,DoubleDistance>
- Parameters:
mbr
- the MBR objecto
- the FeatureVector object
- Returns:
- the minimum distance between the given MBR and the SpatialData
object according to this distance function
- See Also:
SpatialDistanceFunction.minDist(de.lmu.ifi.dbs.elki.utilities.HyperBoundingBox, de.lmu.ifi.dbs.elki.data.FeatureVector)
minDist
public DoubleDistance minDist(HyperBoundingBox mbr,
Integer id)
- Computes the minimum distance between the given MBR and the NumberVector object
with the given id according to this distance function.
- Specified by:
minDist
in interface SpatialDistanceFunction<O extends RealVector<O,?>,DoubleDistance>
- Parameters:
mbr
- the MBR objectid
- the id of the NumberVector object
- Returns:
- the minimum distance between the given MBR and the SpatialData object
according to this distance function
distance
public DoubleDistance distance(HyperBoundingBox mbr1,
HyperBoundingBox mbr2)
- Computes the distance between the two given MBRs according to this
distance function.
- Specified by:
distance
in interface SpatialDistanceFunction<O extends RealVector<O,?>,DoubleDistance>
- Parameters:
mbr1
- the first MBR objectmbr2
- the second MBR object
- Returns:
- the distance between the two given MBRs according to this
distance function
- See Also:
SpatialDistanceFunction.distance(HyperBoundingBox, de.lmu.ifi.dbs.elki.utilities.HyperBoundingBox)
centerDistance
public DoubleDistance centerDistance(HyperBoundingBox mbr1,
HyperBoundingBox mbr2)
- Computes the distance between the centroids of the two given MBRs
according to this distance function.
- Specified by:
centerDistance
in interface SpatialDistanceFunction<O extends RealVector<O,?>,DoubleDistance>
- Parameters:
mbr1
- the first MBR objectmbr2
- the second MBR object
- Returns:
- the distance between the centroids of the two given MBRs
according to this distance function
- See Also:
SpatialDistanceFunction.centerDistance(HyperBoundingBox, de.lmu.ifi.dbs.elki.utilities.HyperBoundingBox)
getAssociationID
AssociationID getAssociationID()
- Returns the assocoiation ID for the association to be set by the preprocessor.
- Specified by:
getAssociationID
in class AbstractLocallyWeightedDistanceFunction<O extends RealVector<O,?>,P extends Preprocessor<O>>