public abstract class HashFun extends Object
HashFun hf = new HashFun.create(); // or, alternatively, HashFun hf = new Hash32Ward(seed); double g = hf.hash(u); // g is in [-1,+1] double g = hf.hash(u,v); double[] g = hf.hash(u,v,w);Omit seed in the constructor call to get a random seed hash function of the specified type.
Modifier | Constructor and Description |
---|---|
protected |
HashFun() |
protected |
HashFun(int seed) |
Modifier and Type | Method and Description |
---|---|
static HashFun |
create() |
static HashFun |
create(int seed)
Creates a new
HashFun object initialized with seed. |
abstract double |
hash(int u) |
abstract double[] |
hash(int[] p) |
abstract double[] |
hash(int u,
int v) |
abstract double[] |
hash(int u,
int v,
int w) |
protected int |
makeRandomSeed() |
public static HashFun create()
public static HashFun create(int seed)
HashFun
object initialized with seed.
Has32Shift is used as the default type.seed
- the seedHashFun
objectprotected int makeRandomSeed()
public abstract double hash(int u)
public abstract double[] hash(int u, int v)
public abstract double[] hash(int u, int v, int w)
public abstract double[] hash(int[] p)
Copyright © 2006–2017, Wilhelm Burger, Mark J. Burge (BSD 2-Clause Simplified License)