|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmaspack.solvers.ProjectedCGSolver
public class ProjectedCGSolver
Solves linear systems using the conjugate gradient algorithm
Field Summary | |
---|---|
boolean |
debug
|
Constructor Summary | |
---|---|
ProjectedCGSolver()
|
Method Summary | |
---|---|
int |
getMaxIterations()
|
int |
getNumIterations()
Returns the number of iterations associated with the last call to solve . |
double |
getRelativeResidual()
Returns the relative residual ||A x - b||/||b|| at the end of the last call to solve . |
double |
getTolerance()
|
IterativeSolver.ToleranceType |
getToleranceType()
|
boolean |
isCompatible(int matrixType)
|
void |
setMaxIterations(int max)
|
void |
setTolerance(double tol)
|
void |
setToleranceType(IterativeSolver.ToleranceType type)
|
boolean |
solve(VectorNd x,
VectorNd lam,
LinearTransformNd A,
SparseMatrixCRS G,
VectorNd b,
VectorNd g)
Solves a linear system A x = b using the projected conjugate gradient method. |
boolean |
solve(VectorNd x,
VectorNd lam,
LinearTransformNd A,
SparseMatrixCRS G,
VectorNd b,
VectorNd g,
double tol,
int maxIter)
Solves a linear system A x = b using the projected conjugate gradient method. |
boolean |
solve(VectorNd x,
VectorNd lam,
LinearTransformNd A,
SparseMatrixCRS G,
VectorNd b,
VectorNd g,
double tol,
int maxIter,
LinearTransformNd P)
Solves a linear system A x = b using the projected conjugate gradient method with a preconditioner. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public boolean debug
Constructor Detail |
---|
public ProjectedCGSolver()
Method Detail |
---|
public double getTolerance()
public void setTolerance(double tol)
public IterativeSolver.ToleranceType getToleranceType()
public void setToleranceType(IterativeSolver.ToleranceType type)
public int getMaxIterations()
public void setMaxIterations(int max)
public boolean solve(VectorNd x, VectorNd lam, LinearTransformNd A, SparseMatrixCRS G, VectorNd b, VectorNd g)
LinearTransformNd
. The method will iterate while relative residual ||A x
- b||/||b|| is greater than a supplied tolerance and the number of
iterations is less than a specified maximum.
x
- result vector, as well as initial guess of the solutionA
- linear transform for the system to be solvedG
- constraint matrixb
- input vectorg
- input vector for G
public boolean solve(VectorNd x, VectorNd lam, LinearTransformNd A, SparseMatrixCRS G, VectorNd b, VectorNd g, double tol, int maxIter)
LinearTransformNd
. The method will iterate while relative residual ||A x
- b||/||b|| is greater than a supplied tolerance and the number of
iterations is less than a specified maximum.
x
- result vector, as well as initial guess of the solutionlam
- result lambda, as well as initial guess of the solutionA
- linear transform for the system to be solvedG
- constraint matrixb
- input vectorg
- input vector for Gtol
- solution tolerancemaxIter
- maximum number of iferations
public boolean solve(VectorNd x, VectorNd lam, LinearTransformNd A, SparseMatrixCRS G, VectorNd b, VectorNd g, double tol, int maxIter, LinearTransformNd P)
LinearTransformNd
. The mul
method of the preconditioner
should implement the transformation y = inv(M) x, where M is a a
preconditioning matrix that approximates A. The method will iterate while
relative residual ||A x - b||/||b|| is greater than a supplied tolerance
and the number of iterations is less than a specified maximum.
x
- result vector, as well as initial guess of the solutionlam
- result lambda, as well as initial guess of the solutionA
- linear transform for the system to be solvedG
- constraint matrixb
- input vectorg
- input vector for Gtol
- solution tolerancemaxIter
- maximum number of iferationsP
- preconditioner (optional, may be specified as null)
public int getNumIterations()
solve
.
public double getRelativeResidual()
solve
.
public boolean isCompatible(int matrixType)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |