52 #define RCODE info->rcode
53 #define MIN(A,B) ( A < B ? A : B )
54 #define MAX(A,B) ( A > B ? A : B )
55 #define SIGN(A) ( A > 0 ? 1 : -1 )
57 #define SMALL 1.0e-150
58 #define EPMACH 1.0e-17
60 typedef enum {None=0, Minimum=1, Verbose=2, Debug=3} PRINT_LEVEL ;
61 typedef enum {False=0, True=1} LOGICAL ;
62 typedef enum { CheckOnRestart=0, CheckEachIter=1 } TERM_CHECK ;
63 typedef enum { Absolute=0, Relative=1 } CONV_CHECK ;
77 typedef void MATVEC(
int n,
double* x,
double* b);
78 typedef void PRECON(
int,
double*,
double*);
87 PRINT_LEVEL errorlevel, monitorlevel, datalevel;
88 FILE *errorfile, *monitorfile, *datafile,
89 *iterfile, *resfile, *miscfile;
95 double precision, normdx, residuum;
96 int iter, rcode, subcode, nomatvec, noprecon, noprecl, noprecr;
102 double tau, t, normdx, residuum;
103 enum { GMRES=0, GBIT=1, PCG=2 } codeid;
104 enum {Initial=1,Intermediate=2,Solution=3,Final=4} mode;
109 FILE *errfile, *monfile, *datfile,
110 *iterfile, *resfile, *miscfile;
111 PRINT_LEVEL errlevel, monlevel, datlevel;
114 #define ERRORLEVEL itlin_ioctl->errlevel
115 #define MONITORLEVEL itlin_ioctl->monlevel
116 #define DATALEVEL itlin_ioctl->datlevel
117 #define ERROR itlin_ioctl->errfile
118 #define MONITOR itlin_ioctl->monfile
119 #define DATA itlin_ioctl->datfile
120 #define FITER itlin_ioctl->iterfile
121 #define FRES itlin_ioctl->resfile
122 #define FMISC itlin_ioctl->miscfile
124 extern void daxpy_(
int *n,
double *alpha,
double *x,
int *incx,
125 double *y,
int *incy);
128 int zibnum_fwalloc(
int size,
double **ptr,
char vname[]);
129 int zibnum_iwalloc(
int size,
int **ptr,
char vname[]);
130 int zibnum_pfwalloc(
int size,
double ***ptr,
char vname[]);
131 double zibnum_scaled_norm2(
int n,
double *v,
double *scale);
132 double zibnum_scaled_sprod(
int n,
double *v1,
double *v2,
double *scale);
133 double zibnum_norm2(
int n,
double *v);
134 void zibnum_scale(
int n,
double *v1,
double *v2,
double *scale);
135 void zibnum_descale(
int n,
double *v1,
double *v2,
double *scale);
136 void itlin_noprecon(
int n,
double *x,
double *z);
137 void itlin_dataout(
int k,
int n,
double *x,
struct ITLIN_DATA *data);
138 int itlin_parcheck_and_print(
int n, MATVEC *
matvec,
139 struct ITLIN_OPT *opt,
int itlin_code);
#define maxiter
maximum number of iterations
void matvec(int n, double *x, double *b)
Used for gmres.