public class RandomStableDistanceFunction extends AbstractDBIDDistanceFunction<DoubleDistance>
Modifier and Type | Class and Description |
---|---|
static class |
RandomStableDistanceFunction.Parameterizer
Parameterization class.
|
Modifier and Type | Field and Description |
---|---|
private long |
seed
Seed for reproducible random.
|
static RandomStableDistanceFunction |
STATIC
Static instance
|
Constructor and Description |
---|
RandomStableDistanceFunction(long seed)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
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() |
getInputTypeRestriction, instantiate, isMetric, isSymmetric
public static final RandomStableDistanceFunction STATIC
private long seed
public RandomStableDistanceFunction(long seed)
public DoubleDistance distance(DBID o1, DBID o2)
DBIDDistanceFunction
distance
in interface DBIDDistanceFunction<DoubleDistance>
distance
in class AbstractDBIDDistanceFunction<DoubleDistance>
o1
- first object ido2
- second object idprivate double pseudoRandom(long seed, int input)
seed
- Seed valueinput
- Input codepublic DoubleDistance getDistanceFactory()
DistanceFunction
getDistanceFactory
in interface DistanceFunction<DBID,DoubleDistance>
getDistanceFactory
in class AbstractDBIDDistanceFunction<DoubleDistance>