Revision 1315 trunk/src/linad99/rngen.cpp

rngen.cpp (revision 1315)
139 139
  /* mag01[x] = x * MATRIX_A  for x=0,1 */
140 140

  
141 141
  if (mti >= N) { /* generate N words at one time */
142
      int kk;
142
      int kk = 0;
143 143

  
144 144
      //if (mti == N+1)   /* if init_genrand() has not been called, */
145 145
      //    init_genrand(5489UL); /* a default initial seed is used */
146 146

  
147
      for (kk=0;kk<N-M;kk++) {
147
      for (;kk<N-M;kk++) {
148 148
          y = (mt[kk]&UPPER_MASK)|(mt[kk+1]&LOWER_MASK);
149 149
          mt[kk] = mt[kk+M] ^ (y >> 1) ^ mag01[y & 0x1UL];
150 150
      }
......
183 183
*/
184 184
double randn(const random_number_generator& rng)
185 185
{
186
  double x,y;
187
  x=((random_number_generator&) rng).better_rand();
188
  y=((random_number_generator&) rng).better_rand();
186
  double x=((random_number_generator&) rng).better_rand();
187
  double y=((random_number_generator&) rng).better_rand();
189 188
  double u=sqrt(-2*log(x))*cos(2*PI*y);
190
  return(u);
189
  return u;
191 190
}
192 191

  
193 192
/**

Also available in: Unified diff