Main Page | Namespace List | Class Hierarchy | Data Structures | Directories | File List | Data Fields | Globals

example-cg.cpp File Reference

#include "../libsrc/toolbox.h"

Functions

template<class T, class S>
int conjugate_gradient (const matrix< T, S > &_K, const matrix< T, S > &_C, packed_vector< S > &_u, const packed_vector< S > &_f, const S _eps, const int _max, communicator< T, S > &_com)
int main (int argc, char **argv)

Function Documentation

template<class T, class S>
int conjugate_gradient const matrix< T, S > &  _K,
const matrix< T, S > &  _C,
packed_vector< S > &  _u,
const packed_vector< S > &  _f,
const S  _eps,
const int  _max,
communicator< T, S > &  _com
 

The conjugate_gradient function implements the preconditioned conjugate gradient algorithm.

Parameters:
_K Input: System matrix.
_C Input: Preconditioner matrix.
_u Input: Solution vector in packed vector format.
_f Input: Right hand side in packed vector format.
_eps Input: Desired accuracy for residual norm.
_max Input: Maximum number of iterations.
_com Input: Communicator object.
Returns:
Output: Number of iterations.

int main int  argc,
char **  argv
 


Generated on Wed Apr 26 17:41:45 2006 for Parallel Toolbox by  doxygen 1.4.2