java.lang.Object de.luschny.math.primes.test.SieveTest
public final class SieveTest
A test and demo suite for de.luschny.math.primes. Example demo: SieveRange is [1, 10.000.000] NumberOfPrimes is 664579. Computation in less than 0.5 sec.
Constructor Summary | |
---|---|
SieveTest() |
Method Summary | |
---|---|
void |
benchmarkTenMillionsDemo() Lets make a small benchmark. |
void |
concatenationDemo() The concatenation property. |
void |
concurrentExecutionDemo() Demonstrates that iterating the prime sieve is thread save. |
void |
isPrimeDemo() Individual prime/composite number demo. |
void |
iteratingSubrangeDemo() Working with a subrange of the sieve. |
static void |
main(java.lang.String[] willBeIgnored) Main - PrimeSieve demo |
void |
nthPrimeDemo() Which is the n-th prime? |
void |
sanityCheck() Test some special cases. |
void |
saveToFileDemo() Save a range of primes to a file. |
void |
scanDemo() Scan the full sieve and count primes. |
void |
sumOfPrimesDemo() Which is the sum of the first n primes? |
void |
toArrayDemo() Extract the primes from the sieve as an array. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait,
wait, wait |
Constructor Detail |
---|
public SieveTest()
Method Detail |
---|
public static void main(java.lang.String[] willBeIgnored)
willBeIgnored
- Parameters, if any, will be ignored.public void scanDemo()
public void iteratingSubrangeDemo()
public void benchmarkTenMillionsDemo()
public void nthPrimeDemo()
public void sumOfPrimesDemo()
public void isPrimeDemo()
public void concatenationDemo()
public void toArrayDemo()
public void saveToFileDemo()
public void sanityCheck()
public void concurrentExecutionDemo()