Class ModularSolver
java.lang.Object
solvers.linearSystemSolver.Solver
solvers.linearSystemSolver.ParallelSolver
solvers.linearSystemSolver.ModularSolver
- All Implemented Interfaces:
SolverInterface
Class which defines a ModularSolver object, which solves the
linear system using residual systems solved by Gaussian elimination.
- Author:
- Michail Makaronidis, 2010
-
Field Summary
Fields inherited from class ParallelSolver
nThreads, pool -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidinitialise(BigRational[][] A, List<Tuple<Integer, Integer>> UList, Set<Integer> uncomputables, int maxA, BigInteger maxb, BigRational maxG) Initialises the solver object, taking into account a list of positions of A that may need to be updated when requested.voidshutdown()Shutsdown the solver, terminating all pools of threads and child processes if any exist.solve(BigRational[] bInput) Solves the linear system using residual systems solved by Gaussian eliminationMethods inherited from class Solver
getTimer, goToULevel, initialise, initialise
-
Constructor Details
-
ModularSolver
public ModularSolver(int nThreads) Constructs a ModularSolver object.- Parameters:
nThreads- Specifies the number of threads that the ModularSolver must use
-
-
Method Details
-
initialise
public void initialise(BigRational[][] A, List<Tuple<Integer, Integer>> UList, Set<Integer> uncomputables, int maxA, BigInteger maxb, BigRational maxG) throws OperationNotSupportedException, InternalErrorExceptionDescription copied from class:SolverInitialises the solver object, taking into account a list of positions of A that may need to be updated when requested. This is needed by the MoM algorithm. Furthermore, some bounds of the maximum elements contained in the linear systems (max A, max B, max Solution = max G) are given.- Overrides:
initialisein classSolver- Parameters:
A- The matrix A of the linear system Ax = bUList- The list containing these positions as Tuple objectsuncomputables- The set of indices of possible zero-columns of AmaxA- The maximum possible element in matrix Amaxb- The maximum possible element of vector bmaxG- The maximum possible legal solution value- Throws:
OperationNotSupportedException- Thrown when the matrix A is not squareInternalErrorException- Thrown when any unrecoverable internal error is encountered during initialisation
-
solve
public BigRational[] solve(BigRational[] bInput) throws OperationNotSupportedException, InconsistentLinearSystemException, InternalErrorException Solves the linear system using residual systems solved by Gaussian elimination- Specified by:
solvein interfaceSolverInterface- Overrides:
solvein classSolver- Parameters:
bInput- The vector b of the linear system Ax = b- Returns:
- A vector containing the solutions of the linear system
- Throws:
OperationNotSupportedException- Thrown when the system cannot be solved due to bad vector b sizeInconsistentLinearSystemException- if the operation cannot be completedInternalErrorException- if the operation cannot be completed
-
shutdown
public void shutdown()Description copied from class:ParallelSolverShutsdown the solver, terminating all pools of threads and child processes if any exist.- Overrides:
shutdownin classParallelSolver
-