MFEM v2.0
Functions
cgsolver.cpp File Reference
#include <iostream>
#include <iomanip>
#include "vector.hpp"
#include "matrix.hpp"
#include "sparsemat.hpp"
Include dependency graph for cgsolver.cpp:

Go to the source code of this file.

Functions

void CG (const Operator &A, const Vector &b, Vector &x, int print_iter=0, int max_num_iter=1000, double RTOLERANCE=10e-12, double ATOLERANCE=10e-24)

Function Documentation

void CG ( const Operator A,
const Vector b,
Vector x,
int  print_iter = 0,
int  max_num_iter = 1000,
double  RTOLERANCE = 10e-12,
double  ATOLERANCE = 10e-24 
)

Conjugate gradient method. Given Matrix A, vector b and initial guess x, iteratively solve A x = b. When the default arguments are used CG doesn't print current residual and number of iterations, maximum number of iterations is 1000, the relative tolerance is 10e-12 and the absolute tolerance is 10e-24.

Definition at line 20 of file cgsolver.cpp.

References add(), Operator::Mult(), Vector::Size(), and subtract().

 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines