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()
IterationMonitor
setFirst
in interface IterationMonitor
public boolean isFirst()
IterationMonitor
isFirst
in interface IterationMonitor
public void next()
IterationMonitor
next
in interface IterationMonitor
public int iterations()
IterationMonitor
iterations
in interface IterationMonitor
public boolean converged(Vector r, Vector x) throws IterativeSolverNotConvergedException
IterationMonitor
converged
in interface IterationMonitor
r
- Residual-vectorx
- State-vectorIterativeSolverNotConvergedException
public boolean converged(double r, Vector x) throws IterativeSolverNotConvergedException
IterationMonitor
converged
in interface IterationMonitor
r
- Residual-normx
- State-vectorIterativeSolverNotConvergedException
public boolean converged(double r) throws IterativeSolverNotConvergedException
IterationMonitor
converged
in interface IterationMonitor
r
- Residual-normIterativeSolverNotConvergedException
protected abstract boolean convergedI(double r, Vector x) throws IterativeSolverNotConvergedException
protected abstract boolean convergedI(double r) throws IterativeSolverNotConvergedException
public boolean converged(Vector r) throws IterativeSolverNotConvergedException
IterationMonitor
converged
in interface IterationMonitor
r
- Residual-vectorIterativeSolverNotConvergedException
public Vector.Norm getNormType()
IterationMonitor
getNormType
in interface IterationMonitor
public void setNormType(Vector.Norm normType)
IterationMonitor
setNormType
in interface IterationMonitor
public IterationReporter getIterationReporter()
IterationMonitor
getIterationReporter
in interface IterationMonitor
public void setIterationReporter(IterationReporter monitor)
IterationMonitor
setIterationReporter
in interface IterationMonitor
public double residual()
IterationMonitor
residual
in interface IterationMonitor
Copyright © 2015. All Rights Reserved.