Package no.uib.cipr.matrix.sparse
Class MatrixIterationMonitor
- java.lang.Object
-
- no.uib.cipr.matrix.sparse.AbstractIterationMonitor
-
- no.uib.cipr.matrix.sparse.DefaultIterationMonitor
-
- no.uib.cipr.matrix.sparse.MatrixIterationMonitor
-
- All Implemented Interfaces:
IterationMonitor
public class MatrixIterationMonitor extends DefaultIterationMonitor
Iteration monitor based on matrix norms. Extends the default linear iteration object to compare with the norm of the system matrix and the right hand side. Can often be a better convergence criteria than the default, but requires the computation of the matrix norm.
-
-
Field Summary
-
Fields inherited from class no.uib.cipr.matrix.sparse.AbstractIterationMonitor
iter, normType, reporter, residual
-
-
Constructor Summary
Constructors Constructor Description MatrixIterationMonitor(double normA, double normb)
Constructor for MatrixIterationMonitor.MatrixIterationMonitor(double normA, double normb, int maxIter, double rtol, double atol, double dtol)
Constructor for MatrixIterationMonitor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
convergedI(double r)
protected boolean
convergedI(double r, Vector x)
void
setMatrixNorm(double normA)
Sets the norm of the system matrixvoid
setVectorNorm(double normb)
Sets the norm of the right hand side vector-
Methods inherited from class no.uib.cipr.matrix.sparse.DefaultIterationMonitor
setAbsoluteTolerance, setDivergenceTolerance, setMaxIterations, setRelativeTolerance
-
Methods inherited from class no.uib.cipr.matrix.sparse.AbstractIterationMonitor
converged, converged, converged, converged, getIterationReporter, getNormType, isFirst, iterations, next, residual, setFirst, setIterationReporter, setNormType
-
-
-
-
Constructor Detail
-
MatrixIterationMonitor
public MatrixIterationMonitor(double normA, double normb, int maxIter, double rtol, double atol, double dtol)
Constructor for MatrixIterationMonitor- Parameters:
normA
- Norm of the matrix Anormb
- Norm of the vector bmaxIter
- Maximum number of iterationsrtol
- Relative convergence tolerance (to initial residual)atol
- Absolute convergence tolerancedtol
- Relative divergence tolerance (to initial residual)
-
MatrixIterationMonitor
public MatrixIterationMonitor(double normA, double normb)
Constructor for MatrixIterationMonitor. Default is 100000 iterations at most, relative tolerance of 1e-5, absolute tolerance of 1e-50 and a divergence tolerance of 1e+5.
-
-
Method Detail
-
setMatrixNorm
public void setMatrixNorm(double normA)
Sets the norm of the system matrix- Parameters:
normA
- Norm of the matrix A
-
setVectorNorm
public void setVectorNorm(double normb)
Sets the norm of the right hand side vector- Parameters:
normb
- Norm of the vector b
-
convergedI
protected boolean convergedI(double r, Vector x) throws IterativeSolverNotConvergedException
- Overrides:
convergedI
in classDefaultIterationMonitor
- Throws:
IterativeSolverNotConvergedException
-
convergedI
protected boolean convergedI(double r)
- Overrides:
convergedI
in classDefaultIterationMonitor
-
-