Class SegmentedSieve

java.lang.Object
de.tilman_neumann.jml.primes.exact.SegmentedSieve

public class SegmentedSieve
extends java.lang.Object
Segmented sieve of Eratosthenes based on Kim Walisch's implementation at http://primesieve.org/segmented_sieve.html
  • Constructor Summary

    Constructors
    Constructor Description
    SegmentedSieve​(SieveCallback clientCallback)  
  • Method Summary

    Modifier and Type Method Description
    static void main​(java.lang.String[] args)
    Test performance without load caused by processPrime().
    void sieve​(long limit)
    Generate primes.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • SegmentedSieve

      public SegmentedSieve​(SieveCallback clientCallback)
  • Method Details

    • sieve

      public void sieve​(long limit)
      Generate primes.
      Parameters:
      limit - biggest number to test for prime
    • main

      public static void main​(java.lang.String[] args)
      Test performance without load caused by processPrime().
      Parameters:
      args - ignored