public class RandomStableDistanceFunction extends AbstractDatabaseDistanceFunction<DBID> implements DBIDDistanceFunction
Modifier and Type | Class and Description |
---|---|
static class |
RandomStableDistanceFunction.Parameterizer
Parameterization class.
|
AbstractDatabaseDistanceFunction.Instance<O>
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 |
---|---|
double |
distance(DBIDRef o1,
DBIDRef o2)
Returns the distance between the two objects specified by their object ids.
|
boolean |
equals(Object obj) |
TypeInformation |
getInputTypeRestriction()
Get the input data type of the function.
|
int |
hashCode() |
<T extends DBID> |
instantiate(Relation<T> relation)
Instantiate with a database to get the actual distance query.
|
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() |
isMetric, isSymmetric
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
isMetric, isSymmetric
public static final RandomStableDistanceFunction STATIC
private long seed
public RandomStableDistanceFunction(long seed)
public double distance(DBIDRef o1, DBIDRef o2)
DBIDDistanceFunction
distance
in interface DBIDDistanceFunction
o1
- first object ido2
- second object idprivate double pseudoRandom(long seed, int input)
seed
- Seed valueinput
- Input codepublic TypeInformation getInputTypeRestriction()
DistanceFunction
getInputTypeRestriction
in interface DistanceFunction<DBID>
public <T extends DBID> DistanceQuery<T> instantiate(Relation<T> relation)
DistanceFunction
instantiate
in interface DistanceFunction<DBID>
relation
- The representation to useCopyright © 2015 ELKI Development Team, Lehr- und Forschungseinheit für Datenbanksysteme, Ludwig-Maximilians-Universität München. License information.