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 int
computeMaxCurvesForN(java.math.BigInteger N)
void
factor(java.math.BigInteger N, SortedMultiset<java.math.BigInteger> primeFactors)
Decomposes the argument N into prime factors.java.math.BigInteger
findSingleFactor(java.math.BigInteger N)
Find a single factor of the given N, which is composite and odd.java.lang.String
getName()
static void
main(java.lang.String[] args)
void
searchFactors(FactorArguments args, FactorResult result)
Find small factors of some N.Methods inherited from class de.tilman_neumann.jml.factor.FactorAlgorithm
factor, getDefault
Methods 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:
getName
in classFactorAlgorithm
- Returns:
- The name of the algorithm, possibly including important parameters.
-
factor
Description copied from class:FactorAlgorithm
Decomposes the argument N into prime factors.- Overrides:
factor
in 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.primeFactors
and eventually some unfactored composites inresult.compositeFactors
.- Overrides:
searchFactors
in 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:FactorAlgorithm
Find a single factor of the given N, which is composite and odd.- Specified by:
findSingleFactor
in 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)
-