@Priority(value=-100) 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(java.lang.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.
|
java.lang.String |
toString() |
isMetric, isSymmetric
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
isMetric, isSquared, 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 java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public 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 © 2019 ELKI Development Team. License information.