|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.lmu.ifi.dbs.elki.distance.distancefunction.AbstractDBIDDistanceFunction<DoubleDistance> de.lmu.ifi.dbs.elki.distance.distancefunction.external.FileBasedDoubleDistanceFunction
@Title(value="File based double distance for database objects.") @Description(value="Loads double distance values from an external text file.") public class FileBasedDoubleDistanceFunction
Provides a DistanceFunction that is based on double distances given by a distance matrix of an external file.
Nested Class Summary | |
---|---|
static class |
FileBasedDoubleDistanceFunction.Parameterizer
Parameterization class. |
Field Summary | |
---|---|
private Map<DBIDPair,DoubleDistance> |
cache
The distance cache |
static OptionID |
MATRIX_ID
Parameter that specifies the name of the distance matrix file. |
static OptionID |
PARSER_ID
Optional parameter to specify the parsers to provide a database, must extend DistanceParser . |
Constructor Summary | |
---|---|
FileBasedDoubleDistanceFunction(DistanceParser<DoubleDistance> parser,
File matrixfile)
Constructor. |
Method Summary | |
---|---|
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. |
DBIDs |
getIDs()
Return a collection of all IDs in the cache. |
private void |
loadCache(DistanceParser<DoubleDistance> parser,
File matrixfile)
|
Methods inherited from class de.lmu.ifi.dbs.elki.distance.distancefunction.AbstractDBIDDistanceFunction |
---|
getInputTypeRestriction, instantiate, isMetric, isSymmetric |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final OptionID MATRIX_ID
Key: -distance.matrix
public static final OptionID PARSER_ID
DistanceParser
. If this parameter is not set,
NumberDistanceParser
is used as parser for all input files.
Key: -distance.parser
private Map<DBIDPair,DoubleDistance> cache
Constructor Detail |
---|
public FileBasedDoubleDistanceFunction(DistanceParser<DoubleDistance> parser, File matrixfile)
parser
- Parsermatrixfile
- input fileMethod Detail |
---|
public DoubleDistance distance(DBID id1, DBID id2)
distance
in interface DBIDDistanceFunction<DoubleDistance>
distance
in class AbstractDBIDDistanceFunction<DoubleDistance>
id1
- first object idid2
- second object id
private void loadCache(DistanceParser<DoubleDistance> parser, File matrixfile) throws IOException
IOException
public DBIDs getIDs()
public DoubleDistance getDistanceFactory()
DistanceFunction
getDistanceFactory
in interface DistanceFunction<DBID,DoubleDistance>
getDistanceFactory
in class AbstractDBIDDistanceFunction<DoubleDistance>
public boolean equals(Object obj)
equals
in class Object
|
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |