de.lmu.ifi.dbs.elki.distance.distancefunction.subspace
Class AbstractPreferenceVectorBasedCorrelationDistanceFunction.Instance<V extends NumberVector<?,?>,P extends PreferenceVectorIndex<V>>

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.database.query.AbstractDataBasedQuery<O>
      extended by de.lmu.ifi.dbs.elki.database.query.distance.AbstractDistanceQuery<O,D>
          extended by de.lmu.ifi.dbs.elki.database.query.distance.AbstractDatabaseDistanceQuery<O,D>
              extended by de.lmu.ifi.dbs.elki.distance.distancefunction.AbstractIndexBasedDistanceFunction.Instance<V,P,PreferenceVectorBasedCorrelationDistance,AbstractPreferenceVectorBasedCorrelationDistanceFunction<? super V,?>>
                  extended by de.lmu.ifi.dbs.elki.distance.distancefunction.subspace.AbstractPreferenceVectorBasedCorrelationDistanceFunction.Instance<V,P>
All Implemented Interfaces:
DatabaseQuery, DistanceQuery<V,PreferenceVectorBasedCorrelationDistance>, IndexBasedDistanceFunction.Instance<V,P,PreferenceVectorBasedCorrelationDistance>
Direct Known Subclasses:
DiSHDistanceFunction.Instance, HiSCDistanceFunction.Instance
Enclosing class:
AbstractPreferenceVectorBasedCorrelationDistanceFunction<V extends NumberVector<?,?>,P extends PreferenceVectorIndex<V>>

public abstract static class AbstractPreferenceVectorBasedCorrelationDistanceFunction.Instance<V extends NumberVector<?,?>,P extends PreferenceVectorIndex<V>>
extends AbstractIndexBasedDistanceFunction.Instance<V,P,PreferenceVectorBasedCorrelationDistance,AbstractPreferenceVectorBasedCorrelationDistanceFunction<? super V,?>>

Instance to compute the distances on an actual database.


Field Summary
(package private)  double epsilon
          The epsilon value
 
Fields inherited from class de.lmu.ifi.dbs.elki.distance.distancefunction.AbstractIndexBasedDistanceFunction.Instance
index, parent
 
Fields inherited from class de.lmu.ifi.dbs.elki.database.query.AbstractDataBasedQuery
relation
 
Fields inherited from interface de.lmu.ifi.dbs.elki.database.query.DatabaseQuery
HINT_BULK, HINT_EXACT, HINT_HEAVY_USE, HINT_NO_CACHE, HINT_OPTIMIZED_ONLY, HINT_SINGLE
 
Constructor Summary
AbstractPreferenceVectorBasedCorrelationDistanceFunction.Instance(Relation<V> database, P preprocessor, double epsilon, AbstractPreferenceVectorBasedCorrelationDistanceFunction<? super V,?> distanceFunction)
          Constructor.
 
Method Summary
abstract  PreferenceVectorBasedCorrelationDistance correlationDistance(V v1, V v2, BitSet pv1, BitSet pv2)
          Computes the correlation distance between the two specified vectors according to the specified preference vectors.
 PreferenceVectorBasedCorrelationDistance distance(DBID id1, DBID id2)
          Returns the distance between the two objects specified by their object ids.
 double weightedDistance(DBID id1, DBID id2, BitSet weightVector)
          Computes the weighted distance between the two specified vectors according to the given preference vector.
 double weightedDistance(V v1, V v2, BitSet weightVector)
          Computes the weighted distance between the two specified vectors according to the given preference vector.
 double weightedPrefereneceVectorDistance(DBID id1, DBID id2)
          Computes the weighted distance between the two specified data vectors according to their preference vectors.
 
Methods inherited from class de.lmu.ifi.dbs.elki.distance.distancefunction.AbstractIndexBasedDistanceFunction.Instance
getDistanceFunction, getIndex
 
Methods inherited from class de.lmu.ifi.dbs.elki.database.query.distance.AbstractDatabaseDistanceQuery
distance, distance, distance
 
Methods inherited from class de.lmu.ifi.dbs.elki.database.query.distance.AbstractDistanceQuery
getDistanceFactory, infiniteDistance, nullDistance, undefinedDistance
 
Methods inherited from class de.lmu.ifi.dbs.elki.database.query.AbstractDataBasedQuery
getRelation
 
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.database.query.distance.DistanceQuery
distance, distance, distance, getDistanceFactory, getRelation, infiniteDistance, nullDistance, undefinedDistance
 

Field Detail

epsilon

final double epsilon
The epsilon value

Constructor Detail

AbstractPreferenceVectorBasedCorrelationDistanceFunction.Instance

public AbstractPreferenceVectorBasedCorrelationDistanceFunction.Instance(Relation<V> database,
                                                                         P preprocessor,
                                                                         double epsilon,
                                                                         AbstractPreferenceVectorBasedCorrelationDistanceFunction<? super V,?> distanceFunction)
Constructor.

Parameters:
database - Database
preprocessor - Preprocessor
epsilon - Epsilon
distanceFunction - parent distance function
Method Detail

distance

public PreferenceVectorBasedCorrelationDistance distance(DBID id1,
                                                         DBID id2)
Description copied from class: AbstractDistanceQuery
Returns the distance between the two objects specified by their object ids.

Specified by:
distance in interface DistanceQuery<V extends NumberVector<?,?>,PreferenceVectorBasedCorrelationDistance>
Specified by:
distance in class AbstractDistanceQuery<V extends NumberVector<?,?>,PreferenceVectorBasedCorrelationDistance>
Parameters:
id1 - first object id
id2 - second object id
Returns:
the distance between the two objects specified by their object ids

correlationDistance

public abstract PreferenceVectorBasedCorrelationDistance correlationDistance(V v1,
                                                                             V v2,
                                                                             BitSet pv1,
                                                                             BitSet pv2)
Computes the correlation distance between the two specified vectors according to the specified preference vectors.

Parameters:
v1 - first vector
v2 - second vector
pv1 - the first preference vector
pv2 - the second preference vector
Returns:
the correlation distance between the two specified vectors

weightedDistance

public double weightedDistance(V v1,
                               V v2,
                               BitSet weightVector)
Computes the weighted distance between the two specified vectors according to the given preference vector.

Parameters:
v1 - the first vector
v2 - the second vector
weightVector - the preference vector
Returns:
the weighted distance between the two specified vectors according to the given preference vector

weightedDistance

public double weightedDistance(DBID id1,
                               DBID id2,
                               BitSet weightVector)
Computes the weighted distance between the two specified vectors according to the given preference vector.

Parameters:
id1 - the id of the first vector
id2 - the id of the second vector
weightVector - the preference vector
Returns:
the weighted distance between the two specified vectors according to the given preference vector

weightedPrefereneceVectorDistance

public double weightedPrefereneceVectorDistance(DBID id1,
                                                DBID id2)
Computes the weighted distance between the two specified data vectors according to their preference vectors.

Parameters:
id1 - the id of the first vector
id2 - the id of the second vector
Returns:
the weighted distance between the two specified vectors according to the preference vector of the first data vector

Release 0.4.0 (2011-09-20_1324)