com.numericalmethod.suanshu.matrix.doubles.matrixtype.sparse.solver.iterative.nonstationary
Class SteepestDescentSolver
java.lang.Object
com.numericalmethod.suanshu.matrix.doubles.matrixtype.sparse.solver.iterative.nonstationary.SteepestDescentSolver
- All Implemented Interfaces:
- IterativeLinearSystemSolver
public class SteepestDescentSolver
- extends java.lang.Object
- implements IterativeLinearSystemSolver
The Steepest Descent method (SDM) solves a symmetric n-by-n linear system.
The convergence is guaranteed if A is symmetric positive definite.
Only left preconditioning is supported in this implementation.
The preconditioner must be symmetric and positive definite.
- See Also:
- Wikipedia: Gradient descent
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DEFAULT_RESIDUAL_REFRESH_RATE
public static final int DEFAULT_RESIDUAL_REFRESH_RATE
- The algorithm recomputes the residual as b - Axi once per this number of iterations
- See Also:
- Constant Field Values
SteepestDescentSolver
public SteepestDescentSolver(PreconditionerFactory leftPreconditionerFactory,
int residualRefreshRate,
int maxIteration,
Tolerance tolerance)
- Construct a Steepest Descent method (SDM) solver.
- Parameters:
leftPreconditionerFactory - constructs a new left preconditionerresidualRefreshRate - the number of iterations before the next refreshmaxIteration - the maximum number of iterationstolerance - the convergence threshold
SteepestDescentSolver
public SteepestDescentSolver(int maxIteration,
Tolerance tolerance)
- Construct a Steepest Descent method (SDM) solver.
- Parameters:
maxIteration - the maximum number of iterationstolerance - the convergence threshold
solve
public IterativeLinearSystemSolver.Solution solve(LSProblem problem)
throws ConvergenceFailure
- Throws:
ConvergenceFailure
solve
public IterativeLinearSystemSolver.Solution solve(LSProblem problem,
IterationMonitor<Vector> monitor)
throws ConvergenceFailure
- Description copied from interface:
IterativeLinearSystemSolver
- Solves iteratively
Ax = b
until the solution converges, i.e., the norm of residual
(b - Ax) is less than or equal to the threshold.
- Specified by:
solve in interface IterativeLinearSystemSolver
- Parameters:
problem - a system of linear equationsmonitor - an iteration monitor
- Returns:
- an (approximate) solution to the linear problem
- Throws:
ConvergenceFailure - if the algorithm fails to converge
Copyright © 2012 Numerical Method Inc. Ltd. All Rights Reserved.