For use with symmetric matrices.
Usage:
SymMatrix A;
cholesky< SymMartix > precond(A);
qmr(A, x, b, precond.left(), precond.right(), iter);
cg(A, x, b, precond(), iter);
Notes: The idea under a concrete Preconditioner such
as Incomplete Cholesky is to create a Preconditioner
object to use in iterative methods.
|
In cholesky.cc:
typedef matrix<Type,
symmetric<lower>,
array< compressed<> >,
row_major>::type Matrix;
Matrix A(5);
dense1D<Type> x(A.nrows(), Type(0));
dense1D<Type> b(A.ncols());
for (dense1D<Type>::iterator i=b.begin(); i!=b.end(); i++)
*i = 1.;
//inomplete cholesky preconditioner
cholesky<Matrix> precond(A);
noisy_iteration<double> iter(b, max_iter, 1e-6);
cg(A, x, b, precond(), iter);
|