public PrimeCountingMod2Odd(int threads)
 {
     this.threads = threads;
     var count = Math.Max(threads, 1);
     hyperbolicSum = new IDivisorSummatoryFunction<UInt128>[count];
     for (var i = 0; i < count; i++)
         hyperbolicSum[i] = new DivisorSummatoryFunctionOdd(0, true);
     hyperbolicSumParallel = new DivisorSummatoryFunctionOdd(threads, true);
 }
        public PrimeCountingMod2Odd(int threads)
        {
            this.threads = threads;
            var count = Math.Max(threads, 1);

            hyperbolicSum = new IDivisorSummatoryFunction <UInt128> [count];
            for (var i = 0; i < count; i++)
            {
                hyperbolicSum[i] = new DivisorSummatoryFunctionOdd(0, true);
            }
            hyperbolicSumParallel = new DivisorSummatoryFunctionOdd(threads, true);
        }
 public PrimeCountingMod3Odd(int threads, bool simple)
 {
     this.threads = threads;
     this.simple = simple;
     t3Map = new Dictionary<BigInteger, BigInteger>();
     var count = Math.Max(threads, 1);
     hyperbolicSum = new IDivisorSummatoryFunction<BigInteger>[count];
     for (var i = 0; i < count; i++)
     {
         if (simple)
             hyperbolicSum[i] = new DivisionFreeDivisorSummatoryFunction(0, false, true);
         else
             hyperbolicSum[i] = new DivisorSummatoryFunctionOdd(0, false);
     }
 }
Example #4
0
 public DivisorSummatoryFunctionOdd(int threads, bool mod2)
 {
     hyperbolicSumUInt64     = new DivisorSummatoryFunctionOddUInt64(threads, mod2);
     hyperbolicSumUInt128    = new DivisorSummatoryFunctionOddUInt128(threads, mod2);
     hyperbolicSumBigInteger = new DivisorSummatoryFunctionOddBigInteger(threads);
 }