Class SingleBlockHybridSieveU

  • All Implemented Interfaces:
    Sieve

    public class SingleBlockHybridSieveU
    extends Object
    implements Sieve
    Combination of a monolithic sieve for large primes > sieveArraySize/3, and a single block sieve for p < sieveArraySize/3. Sieving incomplete blocks makes no sense, because we have to run through all primes, but harvest only a small x-range. Thus, we arrange blocks such that block size divides sieve array size.
    Author:
    Tilman Neumann
    • Constructor Detail

      • SingleBlockHybridSieveU

        public SingleBlockHybridSieveU​(int blockSize)
        Full constructor.
        Parameters:
        blockSize - size of a sieve segment
    • Method Detail

      • getName

        public String getName()
        Specified by:
        getName in interface Sieve
        Returns:
        the name of this sieve algorithm
      • initializeForN

        public void initializeForN​(SieveParams sieveParams,
                                   int mergedBaseSize)
        Description copied from interface: Sieve
        Initialize for a new N. In PSIQS, this method is called for each thread, so things that can be computed before should be computed before.
        Specified by:
        initializeForN in interface Sieve
        Parameters:
        sieveParams - basic sieve parameters for a new N
        mergedBaseSize - size of prime/power base after merging, before filtering
      • initializeForAParameter

        public void initializeForAParameter​(SolutionArrays solutionArrays,
                                            int filteredBaseSize)
        Description copied from interface: Sieve
        Set (filtered) prime base and smallest x1, x2 solutions for a new a-parameter.
        Specified by:
        initializeForAParameter in interface Sieve
        filteredBaseSize - number of primes and powers use for sieving
      • sieve

        public List<Integer> sieve()
        Description copied from interface: Sieve
        Sieve for a new set of x1, x2 solutions.
        Specified by:
        sieve in interface Sieve
        Returns:
        list of sieve locations x where Q(x) is smooth enough to be passed to trial division
      • getReport

        public SieveReport getReport()
        Specified by:
        getReport in interface Sieve
        Returns:
        description of the durations of the individual sub-phases
      • cleanUp

        public void cleanUp()
        Description copied from interface: Sieve
        Release memory after a factorization.
        Specified by:
        cleanUp in interface Sieve