public abstract class AbstractIterationMonitor extends Object implements IterationMonitor
| Modifier and Type | Field and Description |
|---|---|
protected int |
iter
Iteration number
|
protected Vector.Norm |
normType
Vector-norm
|
protected IterationReporter |
reporter
Iteration reporter
|
protected double |
residual
Current residual
|
| Constructor and Description |
|---|
AbstractIterationMonitor()
Constructor for AbstractIterationMonitor.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
converged(double r)
Checks for convergence
|
boolean |
converged(double r,
Vector x)
Checks for convergence
|
boolean |
converged(Vector r)
Checks for convergence
|
boolean |
converged(Vector r,
Vector x)
Checks for convergence
|
protected abstract boolean |
convergedI(double r) |
protected abstract boolean |
convergedI(double r,
Vector x) |
IterationReporter |
getIterationReporter()
Returns current iteration reporter
|
Vector.Norm |
getNormType()
Returns the vector-norm in use
|
boolean |
isFirst()
Returns true for the first iteration
|
int |
iterations()
Number of iterations performed
|
void |
next()
Increases iteration counter
|
double |
residual()
Returns current residual
|
void |
setFirst()
Resets the iteration
|
void |
setIterationReporter(IterationReporter monitor)
Sets new iteration reporter
|
void |
setNormType(Vector.Norm normType)
Sets the vector-norm to calculate with
|
protected int iter
protected Vector.Norm normType
protected IterationReporter reporter
protected double residual
public AbstractIterationMonitor()
public void setFirst()
IterationMonitorsetFirst in interface IterationMonitorpublic boolean isFirst()
IterationMonitorisFirst in interface IterationMonitorpublic void next()
IterationMonitornext in interface IterationMonitorpublic int iterations()
IterationMonitoriterations in interface IterationMonitorpublic boolean converged(Vector r, Vector x) throws IterativeSolverNotConvergedException
IterationMonitorconverged in interface IterationMonitorr - Residual-vectorx - State-vectorIterativeSolverNotConvergedExceptionpublic boolean converged(double r,
Vector x)
throws IterativeSolverNotConvergedException
IterationMonitorconverged in interface IterationMonitorr - Residual-normx - State-vectorIterativeSolverNotConvergedExceptionpublic boolean converged(double r)
throws IterativeSolverNotConvergedException
IterationMonitorconverged in interface IterationMonitorr - Residual-normIterativeSolverNotConvergedExceptionprotected abstract boolean convergedI(double r,
Vector x)
throws IterativeSolverNotConvergedException
protected abstract boolean convergedI(double r)
throws IterativeSolverNotConvergedException
public boolean converged(Vector r) throws IterativeSolverNotConvergedException
IterationMonitorconverged in interface IterationMonitorr - Residual-vectorIterativeSolverNotConvergedExceptionpublic Vector.Norm getNormType()
IterationMonitorgetNormType in interface IterationMonitorpublic void setNormType(Vector.Norm normType)
IterationMonitorsetNormType in interface IterationMonitorpublic IterationReporter getIterationReporter()
IterationMonitorgetIterationReporter in interface IterationMonitorpublic void setIterationReporter(IterationReporter monitor)
IterationMonitorsetIterationReporter in interface IterationMonitorpublic double residual()
IterationMonitorresidual in interface IterationMonitorCopyright © 2015. All Rights Reserved.