Lines Matching refs:primes

70         // Get primes through specified bound (inclusive) and Integer.MAX_VALUE
71 NavigableSet<BigInteger> primes = getPrimes(upperBound);
73 // Check whether known primes are identified as such
74 boolean primeTest = checkPrime(primes, certainty, parallel);
80 // Check whether known non-primes are not identified as primes
81 boolean nonPrimeTest = checkNonPrime(primes, certainty);
103 * @return bits indicating which indexes represent primes
121 * Load the primes up to the specified bound (inclusive) into a
125 * @return a set of primes
129 NavigableSet<BigInteger> primes = bs.stream()
132 primes.add(BigInteger.valueOf(Integer.MAX_VALUE));
133 System.out.println(String.format("Created %d primes", primes.size()));
134 return primes;
138 * Verifies whether the fraction of probable primes detected is at least 1 -
143 private static boolean checkPrime(Set<BigInteger> primes,
146 long probablePrimes = (parallel ? primes.parallelStream() : primes.stream())
155 BigInteger t = BigInteger.valueOf(primes.size());
175 private static boolean checkNonPrime(NavigableSet<BigInteger> primes,
179 maxPrime = primes.last().intValueExact();
190 // If there are any non-probable primes also in the primes list then fail.
191 boolean failed = nonPrimeBigInts.stream().anyMatch(primes::contains);
193 // In the event, print which purported non-primes were actually prime.
196 if (primes.contains(bigInt)) {
206 * Verifies whether a specified subset of Mersenne primes are correctly
222 System.out.println("Checking first "+MERSENNE_EXPONENTS.length+" Mersenne primes");