Class TDiv31Barrett
- java.lang.Object
-
- de.tilman_neumann.jml.factor.FactorAlgorithm
-
- de.tilman_neumann.jml.factor.tdiv.TDiv31Barrett
-
public class TDiv31Barrett extends FactorAlgorithm
Trial division using long-valued Barrett reduction, see https://en.wikipedia.org/wiki/Barrett_reduction. Significantly faster than TDiv31Inverse.
-
-
Field Summary
-
Fields inherited from class de.tilman_neumann.jml.factor.FactorAlgorithm
DEFAULT, NUM_PRIMES_FOR_31_BIT_TDIV, tdivLimit
-
-
Constructor Summary
Constructors Constructor Description TDiv31Barrett()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidfactor(BigInteger Nbig, int Nexp, SortedMultiset<BigInteger> primeFactors)Find all factor of NBig, which must have less than 32 bit.voidfactor(BigInteger Nbig, SortedMultiset<BigInteger> primeFactors)Decomposes the argument N into prime factors.intfindSingleFactor(int N)BigIntegerfindSingleFactor(BigInteger N)Find a single factor of the given N, which is composite and odd.StringgetName()-
Methods inherited from class de.tilman_neumann.jml.factor.FactorAlgorithm
factor, searchFactors
-
-
-
-
Method Detail
-
getName
public String getName()
- Specified by:
getNamein classFactorAlgorithm- Returns:
- The name of the algorithm, possibly including important parameters.
-
factor
public void factor(BigInteger Nbig, SortedMultiset<BigInteger> primeFactors)
Description copied from class:FactorAlgorithmDecomposes the argument N into prime factors.- Overrides:
factorin classFactorAlgorithm- Parameters:
Nbig- Number to factor.primeFactors- a map to which found factors are added
-
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 primeFactorsprimeFactors-
-
findSingleFactor
public BigInteger findSingleFactor(BigInteger N)
Description copied from class:FactorAlgorithmFind a single factor of the given N, which is composite and odd.- Specified by:
findSingleFactorin classFactorAlgorithm- Returns:
- factor
-
findSingleFactor
public int findSingleFactor(int N)
-
-