Beispiel #1
0
 public DivisorSummatoryFunctionOddUInt128(int threads, bool mod2)
 {
     this.threads    = threads;
     this.mod2       = mod2;
     finished        = new ManualResetEventSlim();
     manualAlgorithm = new DivisionFreeDivisorSummatoryFunction(threads, false, true, mod2);
 }
        public PrimeCountingMod3(int threads)
        {
            this.threads = threads;
            t3Map        = new Dictionary <BigInteger, BigInteger>();
            var count = Math.Max(threads, 1);

            hyperbolicSum = new DivisionFreeDivisorSummatoryFunction[count];
            for (var i = 0; i < count; i++)
            {
                hyperbolicSum[i] = new DivisionFreeDivisorSummatoryFunction(0, false, false);
            }
        }
Beispiel #3
0
 public DivisorSummatoryFunctionOddBigInteger(int threads)
 {
     this.threads    = threads;
     queue           = new BlockingCollection <Region>();
     finished        = new ManualResetEventSlim();
     manualAlgorithm = new DivisionFreeDivisorSummatoryFunction(threads, false, true);
     stores          = new IStore <MutableInteger> [Math.Max(threads, 1)];
     for (var i = 0; i < Math.Max(threads, 1); i++)
     {
         stores[i] = new MutableIntegerStore(8);
     }
 }
Beispiel #4
0
        public BigInteger Evaluate(BigInteger n, BigInteger x0, BigInteger xmax)
        {
            var result = EvaluateInternal(n, x0, xmax);

#if false
            var expected = new DivisionFreeDivisorSummatoryFunction(0, false, true).Evaluate(n, x0, xmax);
            if (expected != result)
            {
                Debugger.Break();
            }
#endif
            return(result);
        }
Beispiel #5
0
        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);
                }
            }
        }
Beispiel #6
0
 public DivisorSummatoryFunctionOddGnuMP()
 {
     stack           = new Stack <Region>();
     manualAlgorithm = new DivisionFreeDivisorSummatoryFunction(0, false, true);
 }