static double calcPrimePowerCount(BigInt nVal){ n = nVal; allocPools(n); fillPrimes(); find_dVals(); calcS2(); resetDPrimeVals(); for (curBlockBase = 0; curBlockBase <= maxSieveValue; curBlockBase += nToTheThird ){ clearPools(); factorRange(); buildDivisorSums(); ceilval = curBlockBase + nToTheThird - 1; if (ceilval > maxSieveValue) { ceilval = maxSieveValue; ended = true; } calcS1(); calcS3(); if (ended) break; } deallocPools(); return t; }
void ActionManager::start(){ clearPools(); //clear all "old" date (from previous games) fighter->setVisible(true); inGame = true; gameOverTime = 0; currentScore = 0; updateScore(); enemyGenerator->reset(SETTINGS->gameMode); }
/* This general algorithm relies on values of D_k' <= n^2/3 and d_k' <= n^1/3. This function calculates those values of d_k'.*/ static void find_dVals(){ curBlockBase = 1; clearPools(); factorRange(); buildDivisorSums(); for (BigInt j = 2; j <= nToTheThird; j++){ for (BigInt m = 1; m < numDPowers; m++){ double s = 0; for (BigInt r = 1; r < numDPowers; r++) s += pow(-1.0, (double)( r + m )) * (1.0 / (r + m + 1)) * (DPrime[j * logn + r] - DPrime[(j - 1) * logn + r]); dPrime[j*(numDPowers + 1)+ m] = s; } } }