Class Lehman_CustomKOrder


  • public class Lehman_CustomKOrder
    extends FactorAlgorithm
    A variant of Lehman's algorithm that allows to arrange the k's in arrays of different "performance levels". k-values that perform very well like those divisible by 315 are tested before others that do not perform that well. For large k we also use congruences of a == kN (mod 2^s) instead of Lehman's a == (k+N) (mod 2^s), which seem to be slightly more discriminative.
    • Constructor Detail

      • Lehman_CustomKOrder

        public Lehman_CustomKOrder​(boolean doTDivFirst)
        Full constructor.
        Parameters:
        doTDivFirst - If true then trial division is done before the Lehman loop. This is recommended if arguments N are known to have factors < cbrt(N) frequently.
    • Method Detail

      • getName

        public String getName()
        Specified by:
        getName in class FactorAlgorithm
        Returns:
        The name of the algorithm, possibly including important parameters.
      • findSingleFactor

        public long findSingleFactor​(long N)
      • main

        public static void main​(String[] args)
        Test.
        Parameters:
        args - ignored