![]() |
00001 // Copyright (C) 2004 Johan Hoffman and Anders Logg. 00002 // Licensed under the GNU GPL Version 2. 00003 00004 #ifndef __CG_H 00005 #define __CG_H 00006 00007 #include <dolfin/constants.h> 00008 #include <dolfin/Preconditioner.h> 00009 #include <dolfin/LinearSolver.h> 00010 00011 namespace dolfin 00012 { 00013 00014 class Matrix; 00015 class Vector; 00016 00018 00019 class CG : public Preconditioner, public LinearSolver 00020 { 00021 public: 00022 00024 CG(const Matrix& A, real tol, unsigned int maxiter); 00025 00027 ~CG(); 00028 00030 void solve(Vector& x, const Vector& b); 00031 00033 static void solve(const Matrix& A, Vector& x, const Vector& b, 00034 real tol, unsigned int maxiter); 00035 00036 private: 00037 00038 // The matrix 00039 const Matrix& A; 00040 00041 // Tolerance 00042 real tol; 00043 00044 // Maximum number of iterations 00045 unsigned int maxiter; 00046 00047 }; 00048 00049 } 00050 00051 #endif
Documentation automatically generated with Doxygen on 10 Sep 2004.