Class Hart_TDiv_Race
java.lang.Object
de.tilman_neumann.jml.factor.FactorAlgorithm
de.tilman_neumann.jml.factor.hart.Hart_TDiv_Race
public class Hart_TDiv_Race extends FactorAlgorithm
A factoring algorithm racing Hart's one line factorizer against trial division.
This is the fastest algorithm for test numbers <= 44 bit when their nature is unknown.
Hart_Fast is faster for semiprimes that do not have factors < cbrt(N).
-
Field Summary
Fields inherited from class de.tilman_neumann.jml.factor.FactorAlgorithm
NUM_PRIMES_FOR_31_BIT_TDIV, tdivLimit
-
Constructor Summary
Constructors Constructor Description Hart_TDiv_Race()
Full constructor. -
Method Summary
Modifier and Type Method Description long
findSingleFactor(long N)
Find a factor of long N.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)
Test.Methods inherited from class de.tilman_neumann.jml.factor.FactorAlgorithm
factor, factor, getDefault, searchFactors
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
Hart_TDiv_Race
public Hart_TDiv_Race()Full constructor.
-
-
Method Details
-
getName
public java.lang.String getName()- Specified by:
getName
in classFactorAlgorithm
- Returns:
- The name of the algorithm, possibly including important parameters.
-
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
-
findSingleFactor
public long findSingleFactor(long N)Find a factor of long N.- Parameters:
N
-- Returns:
- factor of N
-
main
public static void main(java.lang.String[] args)Test.- Parameters:
args
- ignored
-