Class TDiv31Inverse


  • public class TDiv31Inverse
    extends FactorAlgorithm
    Trial division factor algorithm using double-valued Barrett reduction, thus replacing division by multiplications. Instead of dividing N by consecutive primes, we store the reciprocals of those primes, too, and multiply N by those reciprocals. Only if such a result is near to an integer we need to do a division. This variant abstains from testing N%primes[i] when the discriminator test indicates a neat division, and unrolls the loop in findSingleFactor().
    • Constructor Detail

      • TDiv31Inverse

        public TDiv31Inverse()
    • Method Detail

      • getName

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

        public void factor​(BigInteger Nbig,
                           int Nexp,
                           SortedMultiset<BigInteger> primeFactors)
        Find all factor of NBig, which must have less than 32 bit.
        Parameters:
        Nbig -
        Nexp - the exponent which with found factors are added to primeFactors
        primeFactors -
      • findSingleFactor

        public int findSingleFactor​(int N)