public CBasicRandomValue(CLinearCongruentGenerator source) { X0 = source.StartState; m = source.Modulo; a = source.A; c = source.C; T = source.Period; Xk = X0; curIndexState = 0; if (NUMBER_OF_CACHE_POOLS < MAX_NUMBER_OF_CACHE_POOLS) { NUMBER_OF_CACHE_POOLS++; pool = new long[POOL_LIMIT_SIZE]; poolExistence = true; } }
static void Main(string[] args) { //CBasicRandomValue random1 = new CBasicRandomValue(); //random1.computePeriodAsParallel(70368714); //random1.checkFirstApproval(); //CBasicRandomValue rndSource = new CBasicRandomValue(); //random1.checkSecondApproval(rndSource); CLinearCongruentGenerator linearGenerator = new CLinearCongruentGenerator(300); CBasicRandomValue basicGenerator = new CBasicRandomValue(linearGenerator); for (int j = 0; j < 1e6; ++j) basicGenerator.next(); Console.WriteLine("--"); }