|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.util.EventObject org.apache.commons.math3.util.IterationEvent org.apache.commons.math3.linear.IterativeLinearSolverEvent org.apache.commons.math3.linear.DefaultIterativeLinearSolverEvent
public class DefaultIterativeLinearSolverEvent
A default concrete implementation of the abstract class
IterativeLinearSolverEvent
.
Field Summary |
---|
Fields inherited from class java.util.EventObject |
---|
source |
Constructor Summary | |
---|---|
DefaultIterativeLinearSolverEvent(Object source,
int iterations,
RealVector x,
RealVector b,
double rnorm)
Creates a new instance of this class. |
|
DefaultIterativeLinearSolverEvent(Object source,
int iterations,
RealVector x,
RealVector b,
RealVector r,
double rnorm)
Creates a new instance of this class. |
Method Summary | |
---|---|
double |
getNormOfResidual()
Returns the norm of the residual. |
RealVector |
getResidual()
Returns the residual. |
RealVector |
getRightHandSideVector()
Returns the current right-hand side of the linear system to be solved. |
RealVector |
getSolution()
Returns the current estimate of the solution to the linear system to be solved. |
boolean |
providesResidual()
Returns true if IterativeLinearSolverEvent.getResidual() is supported. |
Methods inherited from class org.apache.commons.math3.util.IterationEvent |
---|
getIterations |
Methods inherited from class java.util.EventObject |
---|
getSource, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public DefaultIterativeLinearSolverEvent(Object source, int iterations, RealVector x, RealVector b, RealVector r, double rnorm)
x
, b
,
r
. Therefore the user must make sure that these vectors are
either unmodifiable views or deep copies of the same vectors actually
used by the source
. Failure to do so may compromise subsequent
iterations of the source
. If the residual vector r
is
null
, then getResidual()
throws a
MathUnsupportedOperationException
, and
providesResidual()
returns false
.
source
- the iterative solver which fired this eventiterations
- the number of iterations performed at the time
this
event is createdx
- the current estimate of the solutionb
- the right-hand side vectorr
- the current estimate of the residual (can be null
)rnorm
- the norm of the current estimate of the residualpublic DefaultIterativeLinearSolverEvent(Object source, int iterations, RealVector x, RealVector b, double rnorm)
x
, b
.
Therefore the user must make sure that these vectors are either
unmodifiable views or deep copies of the same vectors actually used by
the source
. Failure to do so may compromise subsequent iterations
of the source
. Callling getResidual()
on instances
returned by this constructor throws a
MathUnsupportedOperationException
, while
providesResidual()
returns false
.
source
- the iterative solver which fired this eventiterations
- the number of iterations performed at the time
this
event is createdx
- the current estimate of the solutionb
- the right-hand side vectorrnorm
- the norm of the current estimate of the residualMethod Detail |
---|
public double getNormOfResidual()
conjugate gradient
method computes a sequence
of residuals, the norm of which is cheap to compute. However, due to
accumulation of round-off errors, this residual might differ from the
true residual after some iterations. See e.g. A. Greenbaum and
Z. Strakos, Predicting the Behavior of Finite Precision Lanzos and
Conjugate Gradient Computations, Technical Report 538, Department of
Computer Science, New York University, 1991 (available
here).
getNormOfResidual
in class IterativeLinearSolverEvent
public RealVector getResidual()
Returns the residual. This is an optional operation, as all iterative linear solvers do not provide cheap estimate of the updated residual vector, in which case
MathUnsupportedOperationException
,IterativeLinearSolverEvent.providesResidual()
returns false
.
The default implementation throws a
MathUnsupportedOperationException
. If this method is overriden,
then IterativeLinearSolverEvent.providesResidual()
should be overriden as well.
MathUnsupportedOperationException
if no residual vector r
was provided at construction time.
getResidual
in class IterativeLinearSolverEvent
public RealVector getRightHandSideVector()
IterativeLinearSolver
.
getRightHandSideVector
in class IterativeLinearSolverEvent
public RealVector getSolution()
IterativeLinearSolver
.
getSolution
in class IterativeLinearSolverEvent
public boolean providesResidual()
true
if IterativeLinearSolverEvent.getResidual()
is supported. The default
implementation returns false
.
This implementation returns true
if a non-null
value was
specified for the residual vector r
at construction time.
providesResidual
in class IterativeLinearSolverEvent
true
if r != null
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |