TheBoussinesqModel  3.2.1
 All Data Structures Files Functions Variables Typedefs Macros Pages
preconditioned_conjugate_gradient.c File Reference

Go to the source code of this file.

Macros

#define MAX_VALUE_DIAG   1e-10
 
#define MAX_REITERTION   1
 

Functions

int get_diagonal (DOUBLEVECTOR *diagonal, t_Matrix_element Matrix)
 
long jacobi_preconditioned_conjugate_gradient_search (long icnt, double epsilon, DOUBLEVECTOR *x, DOUBLEVECTOR *b, t_Matrix_element funz)
 

Variables

t_Matrix Functional_M
 

Macro Definition Documentation

#define MAX_REITERTION   1
#define MAX_VALUE_DIAG   1e-10

Definition at line 35 of file preconditioned_conjugate_gradient.c.

Function Documentation

long jacobi_preconditioned_conjugate_gradient_search ( long  icnt,
double  epsilon,
DOUBLEVECTOR x,
DOUBLEVECTOR b,
t_Matrix_element  funz 
)
Parameters
icnt- (long) number of reiterations
epsilon- (double) required tollerance (2-order norm of the residuals)
x- (DOUBLEVECTOR *) vector of the unknowns x in Ax=b
b- (DOUBLEVECTOR *) vector of b in Ax=b
funz- (t_Matrix_element) - (int) pointer to the application A (x and y doublevector y=A(param)x ) it return 0 in case of success, -1 otherwise.

algorithm proposed by Jonathan Richard Shewckuck in http://www.cs.cmu.edu/~jrs/jrspapers.html#cg and http://www.cs.cmu.edu/~quake-papers/painless-conjugate-gradient.pdf

Author
Emanuele Cordano
Date
June 2009
Returns
the number of reitarations

Definition at line 80 of file preconditioned_conjugate_gradient.c.

References free_doublevector(), get_diagonal(), max_doublevector(), MAX_REITERTION, new_doublevector(), DOUBLEVECTOR::nh, DOUBLEVECTOR::nl, and stop_execution().

Referenced by Newton_convergence().

Variable Documentation

t_Matrix Functional_M

Definition at line 39 of file preconditioned_conjugate_gradient.c.