Package de.tilman_neumann.jml.factor.ecm
Class EllipticCurveMethod
java.lang.Object
de.tilman_neumann.jml.factor.FactorAlgorithm
de.tilman_neumann.jml.factor.ecm.EllipticCurveMethod
public class EllipticCurveMethod extends FactorAlgorithm
Use Elliptic Curve Method to find the prime number factors of a given BigInteger.
-
Field Summary
Fields inherited from class de.tilman_neumann.jml.factor.FactorAlgorithm
NUM_PRIMES_FOR_31_BIT_TDIV, tdivLimit -
Constructor Summary
Constructors Constructor Description EllipticCurveMethod(int maxCurves)Full constructor. -
Method Summary
Modifier and Type Method Description static intcomputeMaxCurvesForN(java.math.BigInteger N)voidfactor(java.math.BigInteger N, SortedMultiset<java.math.BigInteger> primeFactors)Decomposes the argument N into prime factors.java.math.BigIntegerfindSingleFactor(java.math.BigInteger N)Find a single factor of the given N, which is composite and odd.java.lang.StringgetName()static voidmain(java.lang.String[] args)voidsearchFactors(FactorArguments args, FactorResult result)Find small factors of some N.Methods inherited from class de.tilman_neumann.jml.factor.FactorAlgorithm
factor, getDefaultMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
EllipticCurveMethod
public EllipticCurveMethod(int maxCurves)Full constructor.- Parameters:
maxCurves- the maximum number of curves to run. -1 means no limit, 0 automatic computation of the parameter, positive values are applied directly.
-
-
Method Details
-
getName
public java.lang.String getName()- Specified by:
getNamein classFactorAlgorithm- Returns:
- The name of the algorithm, possibly including important parameters.
-
factor
Description copied from class:FactorAlgorithmDecomposes the argument N into prime factors.- Overrides:
factorin classFactorAlgorithm- Parameters:
N- Number to factor.primeFactors- a map to which found factors are added
-
searchFactors
Find small factors of some N. Returns found factors inresult.primeFactorsand eventually some unfactored composites inresult.compositeFactors.- Overrides:
searchFactorsin classFactorAlgorithm- Parameters:
args-result- the result of the factoring attempt. Should be initialized only once by the caller to reduce overhead.
-
findSingleFactor
public java.math.BigInteger findSingleFactor(java.math.BigInteger N)Description copied from class:FactorAlgorithmFind a single factor of the given N, which is composite and odd.- Specified by:
findSingleFactorin classFactorAlgorithm- Parameters:
N- number to be factored.- Returns:
- factor
-
computeMaxCurvesForN
public static int computeMaxCurvesForN(java.math.BigInteger N) -
main
public static void main(java.lang.String[] args)
-