Class SquFoF31Preload
java.lang.Object
de.tilman_neumann.jml.factor.FactorAlgorithm
de.tilman_neumann.jml.factor.squfof.SquFoF31Preload
public class SquFoF31Preload extends FactorAlgorithm
Shanks' SQUFOF algorithm, 31-bit version.
This version works without fail for N <= 2^52 and is faster than SquFoF63 for N <= 2^51.
This version preloads the square-free sequence, but that makes hardly a difference.
-
Field Summary
Fields inherited from class de.tilman_neumann.jml.factor.FactorAlgorithm
NUM_PRIMES_FOR_31_BIT_TDIV, tdivLimit
-
Constructor Summary
Constructors Constructor Description SquFoF31Preload()
-
Method Summary
Modifier and Type Method Description long
findSingleFactor(long N)
Find a factor of the given composite N. Warning: This method will not return when called with a prime argument.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.protected java.lang.Long
test(int Q_ip1)
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
-
SquFoF31Preload
public SquFoF31Preload()
-
-
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 the given composite N. Warning: This method will not return when called with a prime argument.- Parameters:
N
- composite integer- Returns:
- factor of N
-
test
protected java.lang.Long test(int Q_ip1) -
main
public static void main(java.lang.String[] args)Test.- Parameters:
args
- ignored
-