Class MatrixSolverBase02
java.lang.Object
de.tilman_neumann.jml.factor.base.matrixSolver.MatrixSolver
de.tilman_neumann.jml.factor.base.matrixSolver.MatrixSolverBase02
- Direct Known Subclasses:
MatrixSolver_Gauss02
,MatrixSolverBase03
public abstract class MatrixSolverBase02 extends MatrixSolver
Base implementation for a congruence equation system (the "LinAlg phase matrix") solver.
Much faster than the first version due to great improvements by Dave McGuigan.
-
Constructor Summary
Constructors Constructor Description MatrixSolverBase02()
-
Method Summary
Modifier and Type Method Description protected java.util.List<Smooth>
removeSingletons(java.util.Collection<? extends Smooth> congruences, java.util.Map<java.lang.Integer,java.lang.Integer> primeIndexMap)
Remove singletons by maintaining a structure of what primes have been seen multiple times.void
solve(java.util.Collection<? extends Smooth> congruences)
Main method to solve a congruence equation system.protected abstract void
solve(java.util.List<Smooth> congruences, java.util.Map<java.lang.Integer,java.lang.Integer> factors_2_columnIndices)
Create the matrix from the pre-processed congruences and solve it.protected void
sortSmooths(java.util.List<Smooth> list)
Methods inherited from class de.tilman_neumann.jml.factor.base.matrixSolver.MatrixSolver
cleanUp, getName, getTestedNullVectorCount, initialize, processNullVector
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
MatrixSolverBase02
public MatrixSolverBase02()
-
-
Method Details
-
solve
Main method to solve a congruence equation system.- Specified by:
solve
in classMatrixSolver
- Parameters:
congruences
- the congruences forming the equation system- Throws:
FactorException
- if a factor of N was found
-
removeSingletons
protected java.util.List<Smooth> removeSingletons(java.util.Collection<? extends Smooth> congruences, java.util.Map<java.lang.Integer,java.lang.Integer> primeIndexMap)Remove singletons by maintaining a structure of what primes have been seen multiple times. When a prime is first seen the congruence is held as a possible singleton. When a prime has been matched, processing of the current congruence and held congruence can proceed. Any other congruences with that prime seen after matching can just proceed.- Parameters:
congruences
- - collecting to be reducedprimeIndexMap
- - Map of primes to unique indexes- Returns:
- list of entries with singletons removed.
-
sortSmooths
-
solve
protected abstract void solve(java.util.List<Smooth> congruences, java.util.Map<java.lang.Integer,java.lang.Integer> factors_2_columnIndices) throws FactorExceptionCreate the matrix from the pre-processed congruences and solve it.- Parameters:
congruences
-factors_2_columnIndices
- map from factors to matrix column indices- Throws:
FactorException
-