@Title(value="File based float distance for database objects.") @Description(value="Loads float distance values from an external matrix.") public class DiskCacheBasedFloatDistanceFunction extends AbstractDBIDDistanceFunction<FloatDistance>
Modifier and Type | Class and Description |
---|---|
static class |
DiskCacheBasedFloatDistanceFunction.Parameterizer
Parameterization class.
|
Modifier and Type | Field and Description |
---|---|
private OnDiskUpperTriangleMatrix |
cache
The distance cache
|
static int |
FLOAT_CACHE_MAGIC
Magic to identify double cache matrices
|
private static int |
FLOAT_SIZE
Storage required for a float value.
|
static OptionID |
MATRIX_ID
Parameter that specifies the name of the distance matrix file.
|
Constructor and Description |
---|
DiskCacheBasedFloatDistanceFunction(OnDiskUpperTriangleMatrix cache)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
FloatDistance |
distance(DBIDRef id1,
DBIDRef id2)
Returns the distance between the two objects specified by their objects
ids.
|
boolean |
equals(Object obj) |
FloatDistance |
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 FLOAT_CACHE_MAGIC
private static final int FLOAT_SIZE
private OnDiskUpperTriangleMatrix cache
public DiskCacheBasedFloatDistanceFunction(OnDiskUpperTriangleMatrix cache)
cache
- Distance matrixpublic FloatDistance distance(DBIDRef id1, DBIDRef id2)
distance
in interface DBIDDistanceFunction<FloatDistance>
distance
in class AbstractDBIDDistanceFunction<FloatDistance>
id1
- first object idid2
- second object idpublic FloatDistance getDistanceFactory()
DistanceFunction
getDistanceFactory
in interface DistanceFunction<DBID,FloatDistance>
getDistanceFactory
in class AbstractDBIDDistanceFunction<FloatDistance>