Environment for
DeveLoping
KDD-Applications
Supported by Index-Structures

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

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.logging.AbstractLoggable
      extended by de.lmu.ifi.dbs.elki.utilities.optionhandling.AbstractParameterizable
          extended by de.lmu.ifi.dbs.elki.distance.AbstractMeasurementFunction<O,D>
              extended by de.lmu.ifi.dbs.elki.distance.distancefunction.AbstractDistanceFunction<O,DoubleDistance>
                  extended by de.lmu.ifi.dbs.elki.distance.distancefunction.AbstractDoubleDistanceFunction<V>
                      extended by de.lmu.ifi.dbs.elki.distance.distancefunction.subspace.AbstractDimensionsSelectingDoubleDistanceFunction<V>
Type Parameters:
V - the type of NumberVector to compute the distances in between
All Implemented Interfaces:
DistanceFunction<V,DoubleDistance>, MeasurementFunction<V,DoubleDistance>, Parameterizable
Direct Known Subclasses:
DimensionsSelectingEuclideanDistanceFunction

public abstract class AbstractDimensionsSelectingDoubleDistanceFunction<V extends NumberVector<V,?>>
extends AbstractDoubleDistanceFunction<V>

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

Author:
Elke Achtert

Field Summary
private  BitSet dimensions
          The dimensions to be considered for distance computation.
static OptionID DIMS_ID
          OptionID for DIMS_PARAM
private  IntListParameter DIMS_PARAM
          Dimensions parameter.
 
Fields inherited from class de.lmu.ifi.dbs.elki.distance.AbstractMeasurementFunction
INFINITY_PATTERN
 
Fields inherited from class de.lmu.ifi.dbs.elki.utilities.optionhandling.AbstractParameterizable
optionHandler
 
Fields inherited from class de.lmu.ifi.dbs.elki.logging.AbstractLoggable
debug, logger
 
Constructor Summary
AbstractDimensionsSelectingDoubleDistanceFunction()
          Provides a distance function that computes the distance (which is a double distance) between feature vectors only in specified dimensions.
 
Method Summary
 BitSet getSelectedDimensions()
          Returns a bit set representing the selected dimensions.
 List<String> setParameters(List<String> args)
          Grabs all specified options from the option handler.
 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.AbstractDoubleDistanceFunction
infiniteDistance, nullDistance, undefinedDistance, valueOf
 
Methods inherited from class de.lmu.ifi.dbs.elki.distance.distancefunction.AbstractDistanceFunction
distance, distance, isInfiniteDistance, isNullDistance, isUndefinedDistance
 
Methods inherited from class de.lmu.ifi.dbs.elki.distance.AbstractMeasurementFunction
getDatabase, matches, requiredInputPattern, setDatabase, setRequiredInputPattern, shortDescription
 
Methods inherited from class de.lmu.ifi.dbs.elki.utilities.optionhandling.AbstractParameterizable
addOption, addParameterizable, addParameterizable, checkGlobalParameterConstraints, collectOptions, getAttributeSettings, getParameters, rememberParametersExcept, removeOption, removeParameterizable
 
Methods inherited from class de.lmu.ifi.dbs.elki.logging.AbstractLoggable
debugFine, debugFiner, debugFinest, exception, progress, verbose, warning
 
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
distance
 
Methods inherited from interface de.lmu.ifi.dbs.elki.distance.MeasurementFunction
requiredInputPattern, setDatabase
 
Methods inherited from interface de.lmu.ifi.dbs.elki.utilities.optionhandling.Parameterizable
checkGlobalParameterConstraints, collectOptions, getParameters, shortDescription
 

Field Detail

DIMS_ID

public static final OptionID DIMS_ID
OptionID for DIMS_PARAM


DIMS_PARAM

private final IntListParameter DIMS_PARAM
Dimensions parameter.


dimensions

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

Constructor Detail

AbstractDimensionsSelectingDoubleDistanceFunction

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

Method Detail

setParameters

public List<String> setParameters(List<String> args)
                           throws ParameterException
Description copied from class: AbstractParameterizable
Grabs all specified options from the option handler. Any extending class should call this method first and return the returned array without further changes, but after setting further required parameters. An example for overwriting this method taking advantage from the previously (in superclasses) defined options would be:

 {
   List remainingParameters = super.setParameters(args);
   // set parameters for your class
   // for example like this:
   if(isSet(MY_PARAM_VALUE_PARAM))
   {
      myParamValue = getParameterValue(MY_PARAM_VALUE_PARAM);
   }
   .
   .
   .
   return remainingParameters;
   // or in case of attributes requesting parameters themselves
   // return parameterizableAttribbute.setParameters(remainingParameters);
 }
 

Specified by:
setParameters in interface Parameterizable
Overrides:
setParameters in class AbstractParameterizable
Parameters:
args - parameters to set the attributes accordingly to
Returns:
a list containing the unused parameters
Throws:
ParameterException - in case of wrong parameter-setting

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

Release 0.2.1 (2009-07-13_1605)