Package elki.distance.subspace
Class AbstractDimensionsSelectingDistance<V extends FeatureVector<?>>
- java.lang.Object
-
- elki.distance.subspace.AbstractDimensionsSelectingDistance<V>
-
- Type Parameters:
V- the type of FeatureVector to compute the distances in between
- All Implemented Interfaces:
Distance<V>,PrimitiveDistance<V>,DimensionSelectingSubspaceDistance<V>
- Direct Known Subclasses:
SubspaceLPNormDistance
public abstract class AbstractDimensionsSelectingDistance<V extends FeatureVector<?>> extends java.lang.Object implements PrimitiveDistance<V>, DimensionSelectingSubspaceDistance<V>
Abstract base class for distances computed only in subspaces. Selected dimensions are encuded as bits in along[].- Since:
- 0.1
- Author:
- Elke Achtert
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAbstractDimensionsSelectingDistance.ParParameterization class.
-
Field Summary
Fields Modifier and Type Field Description protected long[]dimensionsThe dimensions to be considered for distance computation.
-
Constructor Summary
Constructors Constructor Description AbstractDimensionsSelectingDistance(long[] dimensions)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description doubledistance(V o1, V o2)Computes the distance between two given DatabaseObjects according to this distance function.booleanequals(java.lang.Object obj)long[]getSelectedDimensions()Returns a bit set representing the selected dimensions.inthashCode()voidsetSelectedDimensions(long[] dimensions)Sets the selected dimensions according to the set bits in the given BitSet.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface elki.distance.Distance
isMetric, isSquared, isSymmetric
-
Methods inherited from interface elki.distance.PrimitiveDistance
getInputTypeRestriction, instantiate
-
-
-
-
Method Detail
-
distance
public double distance(V o1, V o2)
Description copied from interface:PrimitiveDistanceComputes the distance between two given DatabaseObjects according to this distance function.- Specified by:
distancein interfacePrimitiveDistance<V extends FeatureVector<?>>- Parameters:
o1- first DatabaseObjecto2- second DatabaseObject- Returns:
- the distance between two given DatabaseObjects according to this distance function
-
getSelectedDimensions
public long[] getSelectedDimensions()
Description copied from interface:DimensionSelectingSubspaceDistanceReturns a bit set representing the selected dimensions.Warning: no defensive copy is performed.
- Specified by:
getSelectedDimensionsin interfaceDimensionSelectingSubspaceDistance<V extends FeatureVector<?>>- Returns:
- a bit set representing the selected dimensions
-
setSelectedDimensions
public void setSelectedDimensions(long[] dimensions)
Description copied from interface:DimensionSelectingSubspaceDistanceSets the selected dimensions according to the set bits in the given BitSet.Warning: no defensive copy is performed.
- Specified by:
setSelectedDimensionsin interfaceDimensionSelectingSubspaceDistance<V extends FeatureVector<?>>- Parameters:
dimensions- a bit set designating the new selected dimensions
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-