|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectch.javasoft.math.Prime
public class Prime
The Prime contains large primes for different integer sizes, and functions around primes see http://primes.utm.edu/lists/2small/0bit.html see http://numbers.computation.free.fr/Constants/Primes/countingPrimes.html
| Constructor Summary | |
|---|---|
Prime()
|
|
| Method Summary | |
|---|---|
static int |
countPrimes(int till,
boolean trace,
boolean traceAllPrimes)
Counts the primes until (inclusive) till, using default cache size, tracing intermediary counts if trace is true, and printing all primes if traceAllPrimes is true. |
static int |
countPrimes(int till,
int cacheSize,
boolean trace,
boolean traceAllPrimes)
Counts the primes until (inclusive) till, using a cache of size cacheSize, tracing intermediary counts if trace is true, and printing all primes if traceAllPrimes is true. |
static int |
getPrime(int index)
Returns the indexth prime, for instance, 2 if index is 0, 3 if index=1 and so on. |
static int |
getPrime07(int index)
Ten largest 7 bit primes: (2^7 - k), k index of POW_2_TO_07_OFFSETS |
static int |
getPrime08(int index)
Ten largest 8 bit primes: (2^8 - k), k index of POW_2_TO_08_OFFSETS |
static int |
getPrime15(int index)
Ten largest 15 bit primes: (2^15 - k), k index of POW_2_TO_15_OFFSETS |
static int |
getPrime16(int index)
Ten largest 16 bit primes: (2^16 - k), k index of POW_2_TO_16_OFFSETS |
static int |
getPrime30(int index)
Ten largest 30 bit primes: (2^30 - k), k index of POW_2_TO_30_OFFSETS |
static int |
getPrime31(int index)
Ten largest 31 bit primes: (2^31 - k), k index of POW_2_TO_31_OFFSETS |
static long |
getPrime32(int index)
Ten largest 32 bit primes: (2^32 - k), k index of POW_2_TO_32_OFFSETS |
static long |
getPrime63(int index)
Ten largest 63 bit primes: (2^63 - k), k index of POW_2_TO_63_OFFSETS |
static int |
getPrimeBelow(int n)
Returns the largest prime below n. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Prime()
| Method Detail |
|---|
public static long getPrime63(int index)
index - use 0..length(POW_2_TO_63_OFFSETS)
public static long getPrime32(int index)
index - use 0..length(POW_2_TO_32_OFFSETS)
public static int getPrime31(int index)
index - use 0..length(POW_2_TO_31_OFFSETS)
public static int getPrime30(int index)
index - use 0..length(POW_2_TO_30_OFFSETS)
public static int getPrime16(int index)
index - use 0..length(POW_2_TO_16_OFFSETS)
public static int getPrime15(int index)
index - use 0..length(POW_2_TO_15_OFFSETS)
public static int getPrime08(int index)
index - use 0..length(POW_2_TO_08_OFFSETS)
public static int getPrime07(int index)
index - use 0..length(POW_2_TO_07_OFFSETS)
public static int getPrime(int index)
index - the index of the desired prime, 0 for prime 2, 1 for prime 3
and so on
public static int getPrimeBelow(int n)
public static int countPrimes(int till,
boolean trace,
boolean traceAllPrimes)
public static int countPrimes(int till,
int cacheSize,
boolean trace,
boolean traceAllPrimes)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||