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 ImmutableMatrixA()Gets the homogeneous part, the coefficient matrix, of the linear system.ImmutableVectorb()Gets the non-homogeneous part, the right-hand side vector, of the linear system.VectorgetInitialGuess()Gets the initial guess of the solution for the problem.PreconditionergetLeftPreconditioner()Gets the left preconditioner.intgetMaxIteration()Gets the specified maximum number of iterations.PreconditionergetRightPreconditioner()Gets the right preconditioner.TolerancegetTolerance()Gets the specifiedToleranceinstance.intsize()Gets the number of variables in the linear system.LSProblemwithInitialGuess(Vector initialGuess)Overrides the initial guess of the solution.LSProblemwithLeftPreconditioner(Preconditioner preconditioner)Overrides the left preconditioner.LSProblemwithMaxIteration(int maxIteration)Overrides the maximum count of iterations.LSProblemwithRightPreconditioner(Preconditioner preconditioner)Overrides the right preconditioner.LSProblemwithTolerance(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 specifiedToleranceinstance.- Returns:
- the
Toleranceinstance
-
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
-
-