The algorithm of ILUT(A, 0, 1.0e-6) is slower than ILU(A). If No fill-in
is arrowed , please use ILU instead of ILUT.
Usage:
Matrix A;
int fill_in=5;
double threshold = 1.0e-5;
ILUT precond(A, fill_in, threshold);
qmr(A, x, b, precond.left(), precond.right(), iter);
Matrix has to be unsymmetric.
For symmetric one, use incomlete cholesky.
Notes: The idea under a concrete Preconditioner such
as Incomplete LU is to create a Preconditioner
object to use in iterative methods.
|
In ilut.cc:
typedef matrix< Type,
rectangle<>,
array< compressed<> >,
row_major >::type Matrix;
Matrix A(5, 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.;
// ilut preconditioner
ILUT<Matrix> precond(A, 0, 1.e-3);
//iteration
noisy_iteration<double> iter(b, max_iter, 1.e-6);
//qmr algorithm
qmr(A, x, b, precond.left(), precond.right(), iter);
|