00001 #ifndef PCG_H
00002 #define PCG_H
00003
00008 #ifdef __cplusplus
00009 extern "C" {
00010 #endif
00011
00015 typedef struct {
00016 int flag;
00017 int iter;
00018 double relres;
00019 } pcg_status_t;
00020
00021
00022 #define PCG_INIT (-1)
00023 #define PCG_OK (0)
00024 #define PCG_MAXITER (1)
00025
00026 void init_pcg_status(pcg_status_t *pstst);
00027
00028 int pcg(double *x, pcg_status_t *pstat,
00029 void (*afun)(double*, const double*, const void*), const void* adata,
00030 void (*mfun)(double*, const double*, const void*), const void* mdata,
00031 double *b, double tol, double maxiter, int n);
00032
00033 #ifdef __cplusplus
00034 }
00035 #endif
00036
00037 #endif