public class CG extends AbstractIterativeSolver
Ax=b
using the Conjugate Gradient method.iter, M
Constructor and Description |
---|
CG(Vector template)
Constructor for CG.
|
Modifier and Type | Method and Description |
---|---|
Vector |
solve(Matrix A,
Vector b,
Vector x)
Solves the given problem, writing result into the vector.
|
checkSizes, getIterationMonitor, getPreconditioner, setIterationMonitor, setPreconditioner
public CG(Vector template)
template
- Vector to use as template for the work vectors needed in the
solution processpublic Vector solve(Matrix A, Vector b, Vector x) throws IterativeSolverNotConvergedException
IterativeSolver
A
- Matrix of the problemb
- Right hand sidex
- Solution is stored here. Also used as initial guessIterativeSolverNotConvergedException