Beispiel #1
0
 public PrimeGenerator(
     PrimeTester tester)
     : this(
         tester,
         new LinkedListLot <long>(new long[]
 {
     firstPrimality,
     secondPrime
 }))
 {
 }
Beispiel #2
0
        public PrimeGenerator(
            PrimeTester tester,
            IEnumerable <long> finiteSet)
        {
            this.tester = tester;

            if (finiteSet == null)
            {
                finiteSet = new LinkedListLot <long>(
                    new long[]
                {
                    firstPrimality, secondPrime
                });
            }

            if (finiteSet is LinkedListLot <long> ll)
            {
                this.currentLinkedList = ll;
                return;
            }

            this.currentLinkedList = new LinkedListLot <long>(
                finiteSet);
        }