Class LSProblem
- java.lang.Object
-
- dev.nm.algebra.linear.matrix.doubles.linearsystem.LSProblem
-
public class LSProblem extends Object
This is the problem of solving a system of linear equations.Ax = b
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ImmutableMatrix
A()
Gets the homogeneous part, the coefficient matrix, of the linear system.ImmutableVector
b()
Gets the non-homogeneous part, the right-hand side vector, of the linear system.Vector
getInitialGuess()
Gets the initial guess of the solution for the problem.Preconditioner
getLeftPreconditioner()
Gets the left preconditioner.int
getMaxIteration()
Gets the specified maximum number of iterations.Preconditioner
getRightPreconditioner()
Gets the right preconditioner.Tolerance
getTolerance()
Gets the specifiedTolerance
instance.int
size()
Gets the number of variables in the linear system.LSProblem
withInitialGuess(Vector initialGuess)
Overrides the initial guess of the solution.LSProblem
withLeftPreconditioner(Preconditioner preconditioner)
Overrides the left preconditioner.LSProblem
withMaxIteration(int maxIteration)
Overrides the maximum count of iterations.LSProblem
withRightPreconditioner(Preconditioner preconditioner)
Overrides the right preconditioner.LSProblem
withTolerance(Tolerance tolerance)
Overrides the tolerance instance.
-
-
-
Method Detail
-
A
public ImmutableMatrix A()
Gets the homogeneous part, the coefficient matrix, of the linear system.- Returns:
- the coefficient matrix
-
b
public ImmutableVector b()
Gets the non-homogeneous part, the right-hand side vector, of the linear system.- Returns:
- the vector
-
size
public int size()
Gets the number of variables in the linear system.- Returns:
- the number of variables
-
withMaxIteration
public LSProblem withMaxIteration(int maxIteration)
Overrides the maximum count of iterations.- Parameters:
maxIteration
- the maximum count of iterations- Returns:
- the new problem with the overriden maximum count of iterations
-
getMaxIteration
public int getMaxIteration()
Gets the specified maximum number of iterations.- Returns:
- the maximum number of iterations
-
withTolerance
public LSProblem withTolerance(Tolerance tolerance)
Overrides the tolerance instance.- Parameters:
tolerance
- the criteria which determines when the solution converges and the iteration stops- Returns:
- the new problem with the overriden tolerance
-
getTolerance
public Tolerance getTolerance()
Gets the specifiedTolerance
instance.- Returns:
- the
Tolerance
instance
-
withInitialGuess
public LSProblem withInitialGuess(Vector initialGuess)
Overrides the initial guess of the solution.- Parameters:
initialGuess
- the initial guess of the solution- Returns:
- the new problem with the overriden initial guess
-
getInitialGuess
public Vector getInitialGuess()
Gets the initial guess of the solution for the problem.- Returns:
- the initial guess
-
withLeftPreconditioner
public LSProblem withLeftPreconditioner(Preconditioner preconditioner)
Overrides the left preconditioner. If right-preconditioning is used, leave this as its default value -IdentityPreconditioner
.- Parameters:
preconditioner
- the preconditioner- Returns:
- the new problem with the overriden left preconditioner
-
getLeftPreconditioner
public Preconditioner getLeftPreconditioner()
Gets the left preconditioner.- Returns:
- the left preconditioner
-
withRightPreconditioner
public LSProblem withRightPreconditioner(Preconditioner preconditioner)
Overrides the right preconditioner. If left-preconditioning is used, leave this as its default value -IdentityPreconditioner
.- Parameters:
preconditioner
- the preconditioner- Returns:
- the new problem with the overriden right preconditioner
-
getRightPreconditioner
public Preconditioner getRightPreconditioner()
Gets the right preconditioner.- Returns:
- the right preconditioner
-
-