src/metaspades/ext/src/easel/esl_random.c
/* mersenne_fill_table()
 * Refill the table with 624 new random numbers.
 * We do this whenever we've reseeded, or when we 
 * run out of numbers.
 */
mersenne_fill_table()
Refill the table with 624 new random numbers.
We do this whenever we've reseeded, or when we
run out of numbers.
mersenne_fill_table () Refill the table with 624 new random numbers . We do this whenever we ' ve reseeded or when we run out of numbers .
static void
mersenne_fill_table(ESL_RANDOMNESS *r)
{
  uint32_t y;
  int      z;
  static uint32_t mag01[2] = { 0x0, 0x9908b0df };
  for (z = 0; z < 227; z++)	
    {
      y = (r->mt[z] & 0x80000000) | (r->mt[z+1] & 0x7fffffff);
      r->mt[z] = r->mt[z+397] ^ (y>>1) ^ mag01[(int)(y & 0x1)]; 
    }
  for (; z < 623; z++)
    {
      y = (r->mt[z] & 0x80000000) | (r->mt[z+1] & 0x7fffffff);
      r->mt[z] = r->mt[z-227] ^ (y>>1) ^ mag01[(int)(y & 0x1)];
    }
  y = (r->mt[623] & 0x80000000) | (r->mt[0] & 0x7fffffff);
  r->mt[623] = r->mt[396] ^ (y>>1) ^ mag01[(int)(y & 0x1)];
  r->mti = 0;
  return;
}
static void mersenne_fill_table ( ESL_RANDOMNESS * r ) { uint32_t y ; int z ; static uint32_t mag01 [ 2 ] = { 0x0 , 0x9908b0df } ; for ( z = 0 ; z < 227 ; z ++ ) { y = ( r -> mt [ z ] & 0x80000000 ) | ( r -> mt [ z + 1 ] & 0x7fffffff ) ; r -> mt [ z ] = r -> mt [ z + 397 ] ^ ( y >> 1 ) ^ mag01 [ ( int ) ( y & 0x1 ) ] ; } for ( ; z < 623 ; z ++ ) { y = ( r -> mt [ z ] & 0x80000000 ) | ( r -> mt [ z + 1 ] & 0x7fffffff ) ; r -> mt [ z ] = r -> mt [ z - 227 ] ^ ( y >> 1 ) ^ mag01 [ ( int ) ( y & 0x1 ) ] ; } y = ( r -> mt [ 623 ] & 0x80000000 ) | ( r -> mt [ 0 ] & 0x7fffffff ) ; r -> mt [ 623 ] = r -> mt [ 396 ] ^ ( y >> 1 ) ^ mag01 [ ( int ) ( y & 0x1 ) ] ; r -> mti = 0 ; return ; }
mersenne_fill_table()
 Refill the table with 624 new random numbers.
mersenne_fill_table () Refill the table with 624 new random numbers .
/* 227 = N-M = 624-397 */ /* yes, the (int) cast is necessary; xref bug #e7; some compilers may try to cast y to signed int otherwise, to use it in an array index */