2 Iterative Linear Solvers: C-callable interface.
4 Orion Sky Lawlor, olawlor@acm.org, 1/16/2003
6 #ifndef __UIUC_CHARM_ILSI_C_H
7 #define __UIUC_CHARM_ILSI_C_H
14 * This struct gives the input and output parameters
15 * for an IDXL_Solver. Because of fortran, it must be
16 * layout-compatible with an array of 20 doubles,
19 /* Input parameters: */
20 double maxResidual
; /* (1) If nonzero, upper bound on total residual error. */
21 double maxIterations
; /* (2) If nonzero, upper bound on number of iterations to take. */
22 double solverIn
[8]; /* Solver-specific input parameters (normally 0) */
23 /* Output parameters: */
24 double residual
; /* (11) Residual error of final solution (estimate) */
25 double iterations
; /* (12) Number of iterations actually taken. */
26 double solverOut
[8]; /* Solver-specific output parameters (normally 0) */
29 /** Set default values for solver parameters. */
30 void ILSI_Param_new(ILSI_Param
*param
);
33 /** An ILSI_Comm is actually a C++ class--see ilsi.h */
34 typedef struct ILSI_Comm ILSI_Comm
;
38 * An ILSI_Solver is a routine that computes, in parallel,
39 * the solution x to the linear equation A x = b.
40 * ILSI_Solvers must be written in C++, since ILSI_Comm is C++.
42 * @param param Assorted input and output parameters for solver.
43 * @param comm The partitioned parallel matrix A and
44 * communication system for the solver.
45 * @param n The length of the local part of the solution vectors.
46 * @param b The local part of the known vector. Never modified.
47 * @param x On input, the initial guess for the solution.
48 * During execution, the intermediate solution values.
49 * On output, the final solution.
51 typedef void (*ILSI_Solver
)(ILSI_Param
*param
, ILSI_Comm
*comm
,
52 int n
, const double *b
, double *x
);
54 /** Conjugate-gradient solver: requires symmetric positive definite matrix */
55 void ILSI_CG_Solver(ILSI_Param
*param
, ILSI_Comm
*comm
,
56 int n
, const double *b
, double *x
);