Class TDiv


  • public class TDiv
    extends FactorAlgorithm
    Trial division for large arguments.
    Author:
    Tilman Neumann
    • Constructor Detail

      • TDiv

        public TDiv()
    • Method Detail

      • getName

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

        public TDiv setTestLimit​(int pLimit)
        Set the upper limit of primes to be tested.
        Parameters:
        pLimit -
        Returns:
        this
      • searchFactors

        public void searchFactors​(FactorArguments args,
                                  FactorResult result)
        Tries to find small factors of a positive, possibly large argument N by doing trial division by all primes p <= pLimit.
        Overrides:
        searchFactors in class FactorAlgorithm
        Parameters:
        args -
        result - a pre-initalized data structure to add results to
      • findSingleFactor

        public BigInteger findSingleFactor​(BigInteger N)
        Find a single factor of the given N, which is composite and odd. Very simple implementation just to complete the FactorAlgorithm interface.
        Specified by:
        findSingleFactor in class FactorAlgorithm
        Returns:
        factor