de.lmu.ifi.dbs.elki.distance.distancefunction
Class LocallyWeightedDistanceFunction<V extends NumberVector<?,?>>

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.distance.distancefunction.AbstractDatabaseDistanceFunction<O,D>
      extended by de.lmu.ifi.dbs.elki.distance.distancefunction.AbstractIndexBasedDistanceFunction<V,FilteredLocalPCAIndex<V>,DoubleDistance>
          extended by de.lmu.ifi.dbs.elki.distance.distancefunction.LocallyWeightedDistanceFunction<V>
Type Parameters:
V - the type of NumberVector to compute the distances in between
All Implemented Interfaces:
DistanceFunction<V,DoubleDistance>, FilteredLocalPCABasedDistanceFunction<V,FilteredLocalPCAIndex<V>,DoubleDistance>, IndexBasedDistanceFunction<V,DoubleDistance>, InspectionUtilFrequentlyScanned, Parameterizable

public class LocallyWeightedDistanceFunction<V extends NumberVector<?,?>>
extends AbstractIndexBasedDistanceFunction<V,FilteredLocalPCAIndex<V>,DoubleDistance>
implements FilteredLocalPCABasedDistanceFunction<V,FilteredLocalPCAIndex<V>,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.


Nested Class Summary
static class LocallyWeightedDistanceFunction.Instance<V extends NumberVector<?,?>>
          Instance of this distance for a particular database.
static class LocallyWeightedDistanceFunction.Parameterizer<V extends NumberVector<?,?>>
          Parameterization class.
 
Field Summary
 
Fields inherited from class de.lmu.ifi.dbs.elki.distance.distancefunction.AbstractIndexBasedDistanceFunction
indexFactory
 
Fields inherited from interface de.lmu.ifi.dbs.elki.distance.distancefunction.IndexBasedDistanceFunction
INDEX_ID
 
Constructor Summary
LocallyWeightedDistanceFunction(LocalProjectionIndex.Factory<V,FilteredLocalPCAIndex<V>> indexFactory)
          Constructor
 
Method Summary
 boolean equals(Object obj)
           
 DoubleDistance getDistanceFactory()
          Method to get the distance functions factory.
<T extends V>
LocallyWeightedDistanceFunction.Instance<T>
instantiate(Relation<T> database)
          Instantiate with a database to get the actual distance query.
 boolean isMetric()
          Is this distance function metric (in particular, does it satisfy the triangle equation?)
 boolean isSymmetric()
          Is this function symmetric?
 
Methods inherited from class de.lmu.ifi.dbs.elki.distance.distancefunction.AbstractIndexBasedDistanceFunction
getInputTypeRestriction
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface de.lmu.ifi.dbs.elki.distance.distancefunction.DistanceFunction
getInputTypeRestriction
 

Constructor Detail

LocallyWeightedDistanceFunction

public LocallyWeightedDistanceFunction(LocalProjectionIndex.Factory<V,FilteredLocalPCAIndex<V>> indexFactory)
Constructor

Parameters:
indexFactory - Index factory
Method Detail

getDistanceFactory

public DoubleDistance getDistanceFactory()
Description copied from interface: DistanceFunction
Method to get the distance functions factory.

Specified by:
getDistanceFactory in interface DistanceFunction<V extends NumberVector<?,?>,DoubleDistance>
Specified by:
getDistanceFactory in class AbstractDatabaseDistanceFunction<V extends NumberVector<?,?>,DoubleDistance>
Returns:
Factory for distance objects

isMetric

public boolean isMetric()
Description copied from interface: DistanceFunction
Is this distance function metric (in particular, does it satisfy the triangle equation?)

Specified by:
isMetric in interface DistanceFunction<V extends NumberVector<?,?>,DoubleDistance>
Overrides:
isMetric in class AbstractIndexBasedDistanceFunction<V extends NumberVector<?,?>,FilteredLocalPCAIndex<V extends NumberVector<?,?>>,DoubleDistance>
Returns:
true when metric.

isSymmetric

public boolean isSymmetric()
Description copied from interface: DistanceFunction
Is this function symmetric?

Specified by:
isSymmetric in interface DistanceFunction<V extends NumberVector<?,?>,DoubleDistance>
Overrides:
isSymmetric in class AbstractIndexBasedDistanceFunction<V extends NumberVector<?,?>,FilteredLocalPCAIndex<V extends NumberVector<?,?>>,DoubleDistance>
Returns:
true when symmetric

instantiate

public <T extends V> LocallyWeightedDistanceFunction.Instance<T> instantiate(Relation<T> database)
Description copied from interface: FilteredLocalPCABasedDistanceFunction
Instantiate with a database to get the actual distance query.

Specified by:
instantiate in interface DistanceFunction<V extends NumberVector<?,?>,DoubleDistance>
Specified by:
instantiate in interface FilteredLocalPCABasedDistanceFunction<V extends NumberVector<?,?>,FilteredLocalPCAIndex<V extends NumberVector<?,?>>,DoubleDistance>
Parameters:
database - The representation to use
Returns:
Actual distance query.

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

Release 0.4.0 (2011-09-20_1324)