--- ray/src/common/urand.c 1991/05/17 12:55:27 1.1 +++ ray/src/common/urand.c 1991/08/12 13:07:02 1.7 @@ -5,7 +5,7 @@ static char SCCSid[] = "$SunId$ LBL"; #endif /* - * Uncorrelated (anticorrelated) random function + * Anticorrelated random function due to Christophe Schlick */ #include "random.h" @@ -44,4 +44,19 @@ int size; else urperm[i+offset]++; } +} + + +int +ilhash(d, n) /* hash a set of integer values */ +register int *d; +register int n; +{ + static int tab[8] = {13623,353,1637,5831,2314,3887,5832,8737}; + register int hval; + + hval = 0; + while (n-- > 0) + hval += *d++ * tab[n&7]; + return(hval); }