de.lmu.ifi.dbs.elki.distance.distancefunction.subspace
Class AbstractDimensionsSelectingDoubleDistanceFunction<V extends FeatureVector<?,?>>

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.distance.distancefunction.AbstractPrimitiveDistanceFunction<V,DoubleDistance>
      extended by de.lmu.ifi.dbs.elki.distance.distancefunction.subspace.AbstractDimensionsSelectingDoubleDistanceFunction<V>
Type Parameters:
V - the type of FeatureVector to compute the distances in between
All Implemented Interfaces:
DistanceFunction<V,DoubleDistance>, PrimitiveDistanceFunction<V,DoubleDistance>, PrimitiveDoubleDistanceFunction<V>, InspectionUtilFrequentlyScanned, Parameterizable
Direct Known Subclasses:
DimensionsSelectingEuclideanDistanceFunction

public abstract class AbstractDimensionsSelectingDoubleDistanceFunction<V extends FeatureVector<?,?>>
extends AbstractPrimitiveDistanceFunction<V,DoubleDistance>
implements PrimitiveDoubleDistanceFunction<V>

Provides a distance function that computes the distance (which is a double distance) between feature vectors only in specified dimensions.


Nested Class Summary
static class AbstractDimensionsSelectingDoubleDistanceFunction.Parameterizer
          Parameterization class.
 
Field Summary
private  BitSet dimensions
          The dimensions to be considered for distance computation.
static OptionID DIMS_ID
          Dimensions parameter.
 
Constructor Summary
AbstractDimensionsSelectingDoubleDistanceFunction(BitSet dimensions)
          Constructor.
 
Method Summary
 DoubleDistance distance(V o1, V o2)
          Computes the distance between two given DatabaseObjects according to this distance function.
 boolean equals(Object obj)
           
 DoubleDistance getDistanceFactory()
          Method to get the distance functions factory.
 BitSet getSelectedDimensions()
          Returns a bit set representing the selected dimensions.
 void setSelectedDimensions(BitSet dimensions)
          Sets the selected dimensions according to the set bits in the given BitSet.
 
Methods inherited from class de.lmu.ifi.dbs.elki.distance.distancefunction.AbstractPrimitiveDistanceFunction
instantiate, isMetric, isSymmetric
 
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.PrimitiveDoubleDistanceFunction
doubleDistance
 
Methods inherited from interface de.lmu.ifi.dbs.elki.distance.distancefunction.PrimitiveDistanceFunction
getInputTypeRestriction
 
Methods inherited from interface de.lmu.ifi.dbs.elki.distance.distancefunction.DistanceFunction
instantiate, isMetric, isSymmetric
 

Field Detail

DIMS_ID

public static final OptionID DIMS_ID
Dimensions parameter.


dimensions

private BitSet dimensions
The dimensions to be considered for distance computation.

Constructor Detail

AbstractDimensionsSelectingDoubleDistanceFunction

public AbstractDimensionsSelectingDoubleDistanceFunction(BitSet dimensions)
Constructor.

Parameters:
dimensions -
Method Detail

distance

public DoubleDistance distance(V o1,
                               V o2)
Description copied from interface: PrimitiveDistanceFunction
Computes the distance between two given DatabaseObjects according to this distance function.

Specified by:
distance in interface PrimitiveDistanceFunction<V extends FeatureVector<?,?>,DoubleDistance>
Specified by:
distance in class AbstractPrimitiveDistanceFunction<V extends FeatureVector<?,?>,DoubleDistance>
Parameters:
o1 - first DatabaseObject
o2 - second DatabaseObject
Returns:
the distance between two given DatabaseObjects according to this distance function

getSelectedDimensions

public BitSet getSelectedDimensions()
Returns a bit set representing the selected dimensions.

Returns:
a bit set representing the selected dimensions

setSelectedDimensions

public void setSelectedDimensions(BitSet dimensions)
Sets the selected dimensions according to the set bits in the given BitSet.

Parameters:
dimensions - a BitSet designating the new selected dimensions

getDistanceFactory

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

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

equals

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

Release 0.4.0 (2011-09-20_1324)