LA_library/gmres.h

14 lines
551 B
C
Raw Normal View History

2005-02-02 21:01:07 +01:00
#include "vec.h"
#include "smat.h"
#include "mat.h"
#include "sparsemat.h"
#include "nonclass.h"
//GMRES solution of a linear system
//matrix can be any class which has nrows(), ncols(), diagonalof() and NRVec::gemv() available
//does not even have to be explicitly stored
template<typename T, typename Matrix>
2005-02-06 15:01:27 +01:00
extern void gmres(const Matrix &bigmat, const NRVec<T> &b, NRVec<T> &x, const bool doguess=1, const double eps=1e-7, const int MAXIT=50, const bool verbose=1, bool square=1,const bool precondition=1, int neustart=0, const int incore=1);