|
||||||||||
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.RandomStableDistanceFunction
public class RandomStableDistanceFunction
This is a dummy distance providing random values (obviously not metrical), useful mostly for unit tests and baseline evaluations: obviously this distance provides no benefit whatsoever. This distance is based on the combined hash codes of the two objects queried, if they are different. Extra caution is done to ensure symmetry and objects with the same ID will have a distance of 0. Obviously this distance is not metrical.
Nested Class Summary | |
---|---|
static class |
RandomStableDistanceFunction.Parameterizer
Parameterization class. |
Field Summary | |
---|---|
private long |
seed
Seed for reproducible random. |
static RandomStableDistanceFunction |
STATIC
Static instance |
Constructor Summary | |
---|---|
RandomStableDistanceFunction(long seed)
Constructor. |
Method Summary | |
---|---|
DoubleDistance |
distance(DBID o1,
DBID o2)
Returns the distance between the two objects specified by their object ids. |
boolean |
equals(Object obj)
|
DoubleDistance |
getDistanceFactory()
Method to get the distance functions factory. |
int |
hashCode()
|
private double |
pseudoRandom(long seed,
int input)
Pseudo random number generator, adaption of the common rand48 generator which can be found in C (man drand48), Java and attributed to Donald Knuth. |
String |
toString()
|
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, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final RandomStableDistanceFunction STATIC
private long seed
Constructor Detail |
---|
public RandomStableDistanceFunction(long seed)
Method Detail |
---|
public DoubleDistance distance(DBID o1, DBID o2)
DBIDDistanceFunction
distance
in interface DBIDDistanceFunction<DoubleDistance>
distance
in class AbstractDBIDDistanceFunction<DoubleDistance>
o1
- first object ido2
- second object id
private double pseudoRandom(long seed, int input)
seed
- Seed valueinput
- Input code
public DoubleDistance getDistanceFactory()
DistanceFunction
getDistanceFactory
in interface DistanceFunction<DBID,DoubleDistance>
getDistanceFactory
in class AbstractDBIDDistanceFunction<DoubleDistance>
public String toString()
toString
in class Object
public boolean equals(Object obj)
equals
in class Object
public int hashCode()
hashCode
in class Object
|
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |