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

Go to the source code of this file.

Typedefs

typedef int(* t_Matrix )(DOUBLEVECTOR *x, DOUBLEVECTOR *y)
 
typedef double(* t_Matrix_element )(long i, DOUBLEVECTOR *eta)
 

Functions

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

Typedef Documentation

typedef int(* t_Matrix)(DOUBLEVECTOR *x, DOUBLEVECTOR *y)

Definition at line 30 of file preconditioned_conjugate_gradient.h.

typedef double(* t_Matrix_element)(long i, DOUBLEVECTOR *eta)

Definition at line 31 of file preconditioned_conjugate_gradient.h.

Function Documentation

long jacobi_preconditioned_conjugate_gradient_search ( long  kkm,
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().