Class PartialSolver
- java.lang.Object
-
- de.tilman_neumann.jml.factor.base.congruence.PartialSolver
-
public class PartialSolver extends Object
A Gaussian solver used to find smooth from partial relations. More specialized algorithms could be used here, but the Gaussian solver works quite fine.- Author:
- Tilman Neumann
-
-
Constructor Summary
Constructors Constructor Description PartialSolver()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
cleanUp()
Release memory after a factorization.protected Map<Long,Integer>
createFactor2ColumnIndexMap(Map<Long,ArrayList<Partial>> factors_2_partials)
Create a map from factors appearing with odd exponent to matrix column indices.String
getName()
protected void
removeSingletons(List<Partial> congruences, Map<Long,ArrayList<Partial>> largeFactors_2_partials)
Remove singletons fromcongruences
.ArrayList<Smooth>
solve(Collection<? extends Partial> congruences)
Solve a partial congruence equation system.protected void
solve(List<Partial> congruences, Map<Long,Integer> factors_2_columnIndices)
Create the matrix from the pre-processed congruences and solve it.
-
-
-
Method Detail
-
getName
public String getName()
-
solve
public ArrayList<Smooth> solve(Collection<? extends Partial> congruences)
Solve a partial congruence equation system.- Parameters:
congruences
- the partial congruence equation system- Returns:
- list of smooth congruences found
-
removeSingletons
protected void removeSingletons(List<Partial> congruences, Map<Long,ArrayList<Partial>> largeFactors_2_partials)
Remove singletons fromcongruences
. This can reduce the size of the equation system; actually it never diminishes the difference (#eqs - #vars). It is very fast, too - like 60ms for a matrix for which solution via Gauss elimination takes 1 minute.- Parameters:
congruences
-largeFactors_2_partials
-
-
createFactor2ColumnIndexMap
protected Map<Long,Integer> createFactor2ColumnIndexMap(Map<Long,ArrayList<Partial>> factors_2_partials)
Create a map from factors appearing with odd exponent to matrix column indices.- Parameters:
factors_2_partials
- unsorted map from factors to the congruences in which they appear with odd exponent- Returns:
- map from factors to column indices
-
solve
protected void solve(List<Partial> congruences, Map<Long,Integer> factors_2_columnIndices)
Create the matrix from the pre-processed congruences and solve it.- Parameters:
congruences
-factors_2_columnIndices
- map from factors to matrix column indices
-
cleanUp
public void cleanUp()
Release memory after a factorization.
-
-