/** Reinitialize the generator as if just built with the given int seed. * <p>The state of the generator is exactly the same as a new * generator built with the same seed.</p> * @param seed the initial seed (32 bits integer) */ @Override public void setSeed(int seed) { // we use a long masked by 0xffffffffL as a poor man unsigned int long longMT = seed; // NB: unlike original C code, we are working with java longs, the cast below makes masking unnecessary mt[0]= (int) longMT; for (mti = 1; mti < N; ++mti) { // See Knuth TAOCP Vol2. 3rd Ed. P.106 for multiplier. // initializer from the 2002-01-09 C version by Makoto Matsumoto longMT = (1812433253l * (longMT ^ (longMT >> 30)) + mti) & 0xffffffffL; mt[mti]= (int) longMT; } clear(); // Clear normal deviate cache }
clear(); // Clear normal deviate cache
/** Reinitialize the generator as if just built with the given int seed. * <p>The state of the generator is exactly the same as a new * generator built with the same seed.</p> * @param seed the initial seed (32 bits integer) */ @Override public void setSeed(int seed) { // we use a long masked by 0xffffffffL as a poor man unsigned int long longMT = seed; // NB: unlike original C code, we are working with java longs, the cast below makes masking unnecessary mt[0]= (int) longMT; for (mti = 1; mti < N; ++mti) { // See Knuth TAOCP Vol2. 3rd Ed. P.106 for multiplier. // initializer from the 2002-01-09 C version by Makoto Matsumoto longMT = (1812433253l * (longMT ^ (longMT >> 30)) + mti) & 0xffffffffL; mt[mti]= (int) longMT; } clear(); // Clear normal deviate cache }
/** Reinitialize the generator as if just built with the given int seed. * <p>The state of the generator is exactly the same as a new * generator built with the same seed.</p> * @param seed the initial seed (32 bits integer) */ @Override public void setSeed(int seed) { // we use a long masked by 0xffffffffL as a poor man unsigned int long longMT = seed; // NB: unlike original C code, we are working with java longs, the cast below makes masking unnecessary mt[0]= (int) longMT; for (mti = 1; mti < N; ++mti) { // See Knuth TAOCP Vol2. 3rd Ed. P.106 for multiplier. // initializer from the 2002-01-09 C version by Makoto Matsumoto longMT = (1812433253l * (longMT ^ (longMT >> 30)) + mti) & 0xffffffffL; mt[mti]= (int) longMT; } clear(); // Clear normal deviate cache }
clear(); // Clear normal deviate cache
clear(); // Clear normal deviate cache