@Title(value="File based double distance for database objects.") @Description(value="Loads double distance values from an external text file.") public class FileBasedDoubleDistanceFunction extends AbstractDBIDRangeDistanceFunction
AsciiDistanceParser
for the default input format.
TODO: use a double[]
instead of the hash map.Modifier and Type | Class and Description |
---|---|
static class |
FileBasedDoubleDistanceFunction.Parameterizer
Parameterization class.
|
AbstractDatabaseDistanceFunction.Instance<O>
Modifier and Type | Field and Description |
---|---|
private gnu.trove.map.TLongDoubleMap |
cache
The distance cache
|
Constructor and Description |
---|
FileBasedDoubleDistanceFunction(DistanceParser parser,
File matrixfile)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
double |
distance(int i1,
int i2)
Compute the distance for two integer offsets.
|
boolean |
equals(Object obj) |
private void |
loadCache(DistanceParser parser,
File matrixfile) |
protected static long |
makeKey(int i1,
int i2)
Combine two integer ids into a long value.
|
distance, getInputTypeRestriction, instantiate
isMetric, isSymmetric
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
isMetric, isSymmetric
public FileBasedDoubleDistanceFunction(DistanceParser parser, File matrixfile)
parser
- Parsermatrixfile
- input filepublic double distance(int i1, int i2)
DBIDRangeDistanceFunction
i1
- First offseti2
- Second offsetprivate void loadCache(DistanceParser parser, File matrixfile) throws IOException
IOException
protected static final long makeKey(int i1, int i2)
i1
- First idi2
- Second idCopyright © 2014 ELKI Development Team, Lehr- und Forschungseinheit für Datenbanksysteme, Ludwig-Maximilians-Universität München. License information.