Top Description Fields Constructors Methods
org.apache.commons.math3.linear

public abstract Class IterativeLinearSolverEvent

extends IterationEvent
Class Inheritance
Known Direct Subclasses
org.apache.commons.math3.linear.DefaultIterativeLinearSolverEvent
Imports
org.apache.commons.math3.util.IterationEvent, org.apache.commons.math3.exception.MathUnsupportedOperationException

This is the base class for all events occurring during the iterations of a IterativeLinearSolver.
Since
3.0

Field Summary

Modifier and TypeField and Description
private static final long

Constructor Summary

AccessConstructor and Description
public
IterativeLinearSolverEvent(final Object
the iterative algorithm on which the event initially occurred
source
,
final int
the number of iterations performed at the time this event is created
iterations
)

Creates a new instance of this class.

Method Summary

Modifier and TypeMethod and Description
public abstract double

Returns:

the norm of the residual, ||r||
getNormOfResidual
()

Returns the norm of the residual.

public RealVector

Returns:

the updated residual, r
getResidual
()

Returns the residual.

public abstract RealVector

Returns:

the right-hand side vector, b
getRightHandSideVector
()

Returns the current right-hand side of the linear system to be solved.

public abstract RealVector

Returns:

the solution, x
getSolution
()

Returns the current estimate of the solution to the linear system to be solved.

public boolean
providesResidual()

Returns true if getResidual() is supported.

Inherited from org.apache.commons.math3.util.IterationEvent:
getIterations

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

Hides org.apache.commons.math3.util.IterationEvent.serialVersionUID.

Serialization identifier.

Constructor Detail

IterativeLinearSolverEventback to summary
public IterativeLinearSolverEvent(final Object source, final int iterations)

Creates a new instance of this class.

Parameters
source:Object

the iterative algorithm on which the event initially occurred

iterations:int

the number of iterations performed at the time this event is created

Method Detail

getNormOfResidualback to summary
public abstract double getNormOfResidual()

Returns the norm of the residual. The returned value is not required to be exact. Instead, the norm of the so-called updated residual (if available) should be returned. For example, the 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).

Returns:double

the norm of the residual, ||r||

getResidualback to summary
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

The default implementation throws a MathUnsupportedOperationException. If this method is overriden, then providesResidual() should be overriden as well.

Returns:RealVector

the updated residual, r

getRightHandSideVectorback to summary
public abstract RealVector getRightHandSideVector()

Returns the current right-hand side of the linear system to be solved. This method should return an unmodifiable view, or a deep copy of the actual right-hand side vector, in order not to compromise subsequent iterations of the source IterativeLinearSolver.

Returns:RealVector

the right-hand side vector, b

getSolutionback to summary
public abstract RealVector getSolution()

Returns the current estimate of the solution to the linear system to be solved. This method should return an unmodifiable view, or a deep copy of the actual current solution, in order not to compromise subsequent iterations of the source IterativeLinearSolver.

Returns:RealVector

the solution, x

providesResidualback to summary
public boolean providesResidual()

Returns true if getResidual() is supported. The default implementation returns false.

Returns:boolean

false if getResidual() throws a MathUnsupportedOperationException