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 class
AbstractDimensionsSelectingDistance.Par
Parameterization class.
-
Field Summary
Fields Modifier and Type Field Description protected long[]
dimensions
The 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 double
distance(V o1, V o2)
Computes the distance between two given DatabaseObjects according to this distance function.boolean
equals(java.lang.Object obj)
long[]
getSelectedDimensions()
Returns a bit set representing the selected dimensions.int
hashCode()
void
setSelectedDimensions(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:PrimitiveDistance
Computes the distance between two given DatabaseObjects according to this distance function.- Specified by:
distance
in 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:DimensionSelectingSubspaceDistance
Returns a bit set representing the selected dimensions.Warning: no defensive copy is performed.
- Specified by:
getSelectedDimensions
in interfaceDimensionSelectingSubspaceDistance<V extends FeatureVector<?>>
- Returns:
- a bit set representing the selected dimensions
-
setSelectedDimensions
public void setSelectedDimensions(long[] dimensions)
Description copied from interface:DimensionSelectingSubspaceDistance
Sets the selected dimensions according to the set bits in the given BitSet.Warning: no defensive copy is performed.
- Specified by:
setSelectedDimensions
in interfaceDimensionSelectingSubspaceDistance<V extends FeatureVector<?>>
- Parameters:
dimensions
- a bit set designating the new selected dimensions
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-