Exemplo n.º 1
0
 result_type operator()() {
   result_type z = _mlcg1() - _mlcg2();
   if(z < 1)
     z += MLCG1::modulus-1;
   return z;
 }
Exemplo n.º 2
0
 /** Returns the next value of the generator. */
 result_type operator()() {
     result_type val1 = _mlcg1();
     result_type val2 = _mlcg2();
     if(val2 < val1) return val1 - val2;
     else return val1 - val2 + MLCG1::modulus - 1;
 }
Exemplo n.º 3
0
 void seed(typename MLCG1::result_type seed1,
           typename MLCG2::result_type seed2)
 {
     _mlcg1(seed1);
     _mlcg2(seed2);
 }