public class PnConjugateGradientMatrix
extends java.lang.Object
Constructor and Description |
---|
PnConjugateGradientMatrix()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
converged()
Returns whether the residual norm is within the tolerance.
|
double |
getActualEstimatedError()
Get estimated error of last solve call.
|
int |
getActualNumOfTakenIterations()
Get number of iterations used in last solve call.
|
double |
getConvergenceTest()
There are four different methods measure the convergence
of the solution of the linear equation used in solve.
|
int |
getDimension()
Get dimension.
|
int |
getMaxNumIterations()
Get maximum number of allowed iterations.
|
PnPreconditioner |
getPreconditioner()
Set the preconditioner to use for the conjugate gradient.
|
double |
getTolerance()
Get desired convergence tolerance of solve.
|
void |
setConvergenceTest(int aTest)
There are four different methods measure the convergence
of the solution of the linear equation used in solve.
|
void |
setDimension(int dim)
Set dimension of surface matrix is based on.
|
void |
setMaxNumIterations(int itmax)
Set maximum number of allowed iterations.
|
void |
setPreconditioner(PnPreconditioner prec)
Set the preconditioner to use for the conjugate gradient.
|
void |
setTolerance(double tol)
Set desired convergence tolerance of solve.
|
double |
solve(PnSparseMatrix smat,
PdVector x,
PdVector b)
Performs a conjugate gradient on a sparse matrix to solve the linear system Ax = b.
|
void |
updatePreconditioner(PnSparseMatrix smat)
When the sparse matrix to solve has changed update the preconditioner
with this method.
|
public boolean converged()
true
if convergence happened within tolerance.public void setPreconditioner(PnPreconditioner prec)
prec
- public PnPreconditioner getPreconditioner()
public double getActualEstimatedError()
public int getActualNumOfTakenIterations()
public void setMaxNumIterations(int itmax)
public int getMaxNumIterations()
public void setTolerance(double tol)
public double getTolerance()
public void setDimension(int dim)
public int getDimension()
public void setConvergenceTest(int aTest)
public double getConvergenceTest()
setConvergenceTest(int)
public void updatePreconditioner(PnSparseMatrix smat)
public double solve(PnSparseMatrix smat, PdVector x, PdVector b)
"