@Title(value="File based double distance for database objects.") @Description(value="Loads double distance values from an external matrix.") public class DiskCacheBasedDoubleDistanceFunction extends AbstractDBIDDistanceFunction<DoubleDistance>
Modifier and Type | Class and Description |
---|---|
static class |
DiskCacheBasedDoubleDistanceFunction.Parameterizer
Parameterization class.
|
Modifier and Type | Field and Description |
---|---|
private OnDiskUpperTriangleMatrix |
cache
The distance matrix
|
static int |
DOUBLE_CACHE_MAGIC
Magic to identify double cache matrices
|
private static int |
DOUBLE_SIZE
Storage required for a double value.
|
static OptionID |
MATRIX_ID
Parameter that specifies the name of the distance matrix file.
|
Constructor and Description |
---|
DiskCacheBasedDoubleDistanceFunction(OnDiskUpperTriangleMatrix cache)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
DoubleDistance |
distance(DBID id1,
DBID id2)
Returns the distance between the two objects specified by their objects
ids.
|
boolean |
equals(Object obj) |
DoubleDistance |
getDistanceFactory()
Method to get the distance functions factory.
|
getInputTypeRestriction, instantiate, isMetric, isSymmetric
public static final OptionID MATRIX_ID
Key: -distance.matrix
public static final int DOUBLE_CACHE_MAGIC
private static final int DOUBLE_SIZE
private OnDiskUpperTriangleMatrix cache
public DiskCacheBasedDoubleDistanceFunction(OnDiskUpperTriangleMatrix cache)
cache
- Distance matrixpublic DoubleDistance distance(DBID id1, DBID id2)
distance
in interface DBIDDistanceFunction<DoubleDistance>
distance
in class AbstractDBIDDistanceFunction<DoubleDistance>
id1
- first object idid2
- second object idpublic DoubleDistance getDistanceFactory()
DistanceFunction
getDistanceFactory
in interface DistanceFunction<DBID,DoubleDistance>
getDistanceFactory
in class AbstractDBIDDistanceFunction<DoubleDistance>