File: proto.tex

package info (click to toggle)
spooles 2.2-16
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 19,760 kB
  • sloc: ansic: 146,836; sh: 7,571; csh: 3,615; makefile: 1,970; perl: 74
file content (502 lines) | stat: -rw-r--r-- 18,933 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
\par
\section{Prototypes and descriptions of {\tt Iter} methods}
\label{section:Iter:proto}
\par
This section contains brief descriptions including prototypes
of all methods found in the {\tt Iter} source directory.
\par

%
% in util.c
%
\subsection{Utility methods}
\label{subsection:Iter:proto:utility}
\par
\begin{enumerate}

%-----------------------------------------------------------------------
\item
\begin{verbatim}
double DenseMtx_frobNorm ( DenseMtx *mtx ) ;
\end{verbatim}
\index{DenseMtx_frobNorm@{\tt DenseMtx\_frobNorm()}}
\par
This method returns the Frobenius norm of the matrix.
\par \noindent {\it Error checking:}
If {\tt mtx} is {\tt NULL},
an error message is printed and the program exits.

%-----------------------------------------------------------------------
\item
\begin{verbatim}
double DenseMtx_twoNormOfColumn ( DenseMtx *mtx, int jcol ) ;
\end{verbatim}
\index{DenseMtx_twoNormOfColumn@{\tt DenseMtx\_twoNormOfColumn()}}
\par
This method returns the two-norm of column {\tt jcol} of the matrix.
\par \noindent {\it Error checking:}
If {\tt mtx} is {\tt NULL}, or {\tt jcol} is not in {\tt [0,ncol-1]},
an error message is printed and the program exits.

%-----------------------------------------------------------------------
\item
\begin{verbatim}
void DenseMtx_colCopy ( DenseMtx *mtxB, int jcol, 
                        DenseMtx *mtxA, int icol ) ;
\end{verbatim}
\index{DenseMtx_colCopy@{\tt DenseMtx\_colCopy()}}
\par
This method copies the column {\tt icol} of the matrix {\tt mtxA}
to the column {\tt jcol} of the matrix {\tt mtxB}.
\par \noindent {\it Error checking:}
If {\tt mtxA} or {\tt mtxB} is {\tt NULL}, {\tt jcol} is not in 
{\tt [0,ncolB-1]}, or {\tt icol} is not in {\tt [0,ncolA-1]} 
an error message is printed and the program exits.

%-----------------------------------------------------------------------
\item
\begin{verbatim}
void DenseMtx_colDotProduct ( DenseMtx *mtxA, int icol,
                         DenseMtx *mtxB, int jcol, double *prod ) ;
\end{verbatim}
\index{DenseMtx_colDotProduct@{\tt DenseMtx\_colDotProduct()}}
\par
This method computes dot product of column {\tt icol} of 
the matrix {\tt mtxA} and column {\tt jcol} of the matrix {\tt mtxB}.  
Note that the  column {\tt icol} of the matrix {\tt mtxA} will be
transported and conjugated for complex entries.
\par \noindent {\it Error checking:}
If {\tt mtxA} or {\tt mtxB} is {\tt NULL}, {\tt jcol} is not in 
{\tt [0,ncolB-1]}, or {\tt icol} is not in {\tt [0,ncolA-1]} 
an error message is printed and the program exits.

%-----------------------------------------------------------------------
\item
\begin{verbatim}
void DenseMtx_colGenAxpy ( double *alpha, DenseMtx *mtxA, int icol,   
                           double *beta,  DenseMtx *mtxB, int jcol ) ;
\end{verbatim}
\index{DenseMtx_colGenAxpy@{\tt DenseMtx\_colGenAxpy()}}
\par
This method replaces column {\tt icol} of the matrix {\tt mtxA} by
{\tt alpha} times itself plus {\tt beta} times column {\tt jcol}
of {\tt mtxB}.
\par \noindent {\it Error checking:}
If {\tt mtxA} or {\tt mtxB} is {\tt NULL}, {\tt jcol} is not in 
{\tt [0,ncolB-1]}, or {\tt icol} is not in {\tt [0,ncolA-1]} 
an error message is printed and the program exits.
%-----------------------------------------------------------------------
\item
\begin{verbatim}
int DenseMtx_mmm ( char *A_opt, char *B_opt, double *beta, DenseMtx *mtxC,
   double *alpha, DenseMtx *mtxA, DenseMtx *mtxB );
\end{verbatim}
\index{DenseMtx_mmm@{\tt DenseMtx\_mmm()}}
This method computes the matrix-matrix multiplication 
$C := \beta C + \alpha AB$,
where $A$, $B$ and $C$ are found in the {\tt C DenseMtx} object,
$\beta$ and $\alpha$ are real or complex in {\tt beta[]} and {\tt alpha[]}.
If any of the input objects are {\tt NULL}, an error message is
printed and the program exits.
{\tt A}, {\tt B} and {\tt C} must all be real or all be complex.
When {\tt A and \tt B} are real, then $\alpha$ = {\tt alpha[0]}.
When {\tt A and \tt B} are complex, then $\alpha$ =
{\tt alpha[0]} + i* {\tt alpha[1]}.
When {\tt C} is real, then $\beta$ = {\tt beta[0]}.
When {\tt C} is complex, then $\beta$ =
{\tt beta[0]} + i* {\tt beta[1]}.
This means that one cannot call the method with a constant as the
third and fifth parameter, e.g.,
{\tt DenseMtx\_mmm(a\_opt, b\_opt, beta, C, alpha, A, B)},
for this may result in a segmentation violation.
The values of $\alpha$ and $\beta$ must be loaded into an array of length 1 or 2
.
\par \noindent {\it Error checking:}
If {\tt beta}, {\tt alpha}, {\tt C}, {\tt A}, {\tt B} are {\tt NULL},
or if {\tt C}, {\tt A} and {\tt B} do not have the same data type
({\tt SPOOLES\_REAL} or {\tt SPOOLES\_COMPLEX}),
or if {\tt A\_opt} or {\tt B\_opt} is invalid, or 
the number of column of {\tt A} and the number of row of {\tt B} is not match, 
an error message is printed and the program exits.
%-----------------------------------------------------------------------
\item
\begin{verbatim}
void FrontMtx_solveOneColumn ( FrontMtx *frontmtx, DenseMtx *solmtx,
   int jcol, DenseMtx *rhsmtx, int icol, SubMtxManager *mtxmanager,
   double cpus[], int msglvl, FILE *msgFile ) ;
\end{verbatim}
\index{FrontMtx_solveOneColumn@{\tt FrontMtx\_solveOneColumn()}}
\par
This method is used to solve one of three linear systems of equations
---
$(U^T + I)D(I + U) X = B$,
$(U^H + I)D(I + U) X = B$ or
$(L + I)D(I + U) X = B$.
Entries of $B$ are read from column {\tt icol} of {\tt rhsmtx} and
entries of $X$ are written to column {\tt jcol} of {\tt solmtx}.
Therefore, {\tt rhsmtx} and {\tt solmtx} can be the same object.
(Note, this does not hold true for an MPI factorization with pivoting.)
The {\tt mtxmanager} object manages the working storage using the solve.
On return the {\tt cpus[]} vector is filled with the following.
\begin{itemize}
\item
{\tt cpus[0]} --- set up the solves
\item
{\tt cpus[1]} --- fetch right hand side and store solution
\item
{\tt cpus[2]} --- forward solve
\item
{\tt cpus[3]} --- diagonal solve
\item
{\tt cpus[4]} --- backward solve
\item
{\tt cpus[5]} --- total time in the method.
\end{itemize}
\par \noindent {\it Error checking:}
If {\tt frontmtx}, {\tt rhsmtx} or {\tt cpus}
is {\tt NULL},
or if {\tt msglvl} $>$ 0 and {\tt msgFile} is {\tt NULL},
an error message is printed and the program exits.
%========================================================================
\end{enumerate}

%
% iterative methods
%
\subsection{Iterative methods}
A collection of iterative methods is provided to solve a sparse
linear system $AX=B$, where $A$ is an {\tt InpMtx} object and
$X$ and $B$ are {\tt DenseMtx} objects.  
This includes left and right preconditioning BiCGStab,
MLBiCGStab, TFQMR, PCG, and BGMRES.
All methods have similar input arguments:
\par
\begin{itemize}
\item
{\tt n\_matrixSize} is order of the matrix $A$.
\item
{\tt type} is the type of entries, {\tt 0} for real, {\tt 1} for complex.
\item
The {\tt symmetryflag} parameter specifies the symmetry of the matrix $A$.
\begin{itemize}
\item
{\tt type = 0 (SPOOLES\_SYMMETRIC)} for $A$ real or complex symmetric,
\item
{\tt type = 1 (SPOOLES\_HERMITIAN)} for $A$ complex Hermitian,
\item
{\tt type = 2 (SPOOLES\_NONSYMMETRIC)} for $A$ real or complex nonsymmetric.
\end{itemize}
\item
{\tt mtxA} is the matrix $A$.
\item
{\tt Precond} is the preconditioner.
\item
{\tt mtxX} is the solution vectors $X$ saved as a {\tt DenseMtx} object.
\item
{\tt mtxB} is the right-hand-side vectors $B$ saved as a {\tt DenseMtx} object.
\item
{\tt itermax} is the maximum iterations number. 
\item
{\tt convergetol}  parameter is a stop criterion for iterative algorithms.
\item
{\tt maxninner} is the maximum number of inner iterations in BGMRES method.
\item
{\tt maxnouter} is the maximum number of outer iterations in BGMRES method.
\item
{\tt pninner} is last number of inner iterations executed in BGMRES method.
\item
{\tt pnouter} is last number of outer iterations executed in BGMRES method.
\item
{\tt mtxQ} is the starting vectors saved as a {\tt DenseMtx} object
  for MLBiCGStab method.
\item
The {\tt msgFile} parameter determines the message file --- if {\tt
msgFile} is {\tt stdout}, then the message file is {\it stdout},
otherwise a file is opened with {\it append} status to receive any
output data.
\item
The {\tt msglvl} parameter determines the amount of output ---
taking {\tt msglvl >= 3} means most of the objects are written
to the message file.

\end{itemize}


\begin{enumerate}
%-----------------------------------------------------------------------
\item
\begin{verbatim}
int bicgstabr ( int n_matrixSize, int type, int symmetryflag, InpMtx *mtxA,
   FrontMtx *Precond, DenseMtx *mtxX, DenseMtx *mtxB, int itermax,
   double convergetol, int msglvl, FILE *msgFile ) ;
\end{verbatim}
\index{bicgstabr@{\tt bicgstabr()}}
\par
This method solves a real linear system using BiCGStab algorithm with right 
preconditioner. 
\par \noindent {\it Return codes:}
{\tt 1} is a normal return.  Otherwise, an error message is printed and 
the program exits.


%-----------------------------------------------------------------------
\item
\begin{verbatim}
int bicgstabl ( int n_matrixSize, int type, int symmetryflag, InpMtx *mtxA,
   FrontMtx *Precond, DenseMtx *mtxX, DenseMtx *mtxB, int itermax,
   double convergetol, int msglvl, FILE *msgFile ) ; 
\end{verbatim}
\index{bicgstabl@{\tt bicgstabl()}}
\par
This method solves a real linear system using BiCGStab algorithm with left 
preconditioner. 
\par \noindent {\it Return codes:}
{\tt 1} is a normal return.  Otherwise, an error message is printed and 
the program exits.

%-----------------------------------------------------------------------
\item
\begin{verbatim}
int mlbicgstabr ( int n_matrixSize, int type, int symmetryflag, InpMtx *mtxA,
   FrontMtx *Precond, DenseMtx *mtxX, DenseMtx *mtxQ, DenseMtx *mtxB,
   int itermax, double convergetol, int msglvl, FILE *msgFile ) ;
\end{verbatim}
\index{mlbicgstabr@{\tt mlbicgstabr()}}
\par
This method solves a real linear system using MLBiCGStab algorithm with right 
preconditioner. 
\par \noindent {\it Return codes:}
{\tt 1} is a normal return.  Otherwise, an error message is printed and 
the program exits.

%-----------------------------------------------------------------------
\item
\begin{verbatim}
int mlbicgstabl ( int n_matrixSize, int type, int symmetryflag, InpMtx *mtxA,
   FrontMtx *Precond, DenseMtx *mtxX, DenseMtx *mtxQ, DenseMtx *mtxB,
   int itermax, double convergetol, int msglvl, FILE *msgFile ) ;
\end{verbatim}
\index{mlbicgstabl@{\tt mlbicgstabl()}}
\par
This method solves a real linear system using MLBiCGStab algorithm with left 
preconditioner. 
\par \noindent {\it Return codes:}
{\tt 1} is a normal return.  Otherwise, an error message is printed and 
the program exits.

%-----------------------------------------------------------------------
\item
\begin{verbatim}
int tfqmrr ( int n_matrixSize, int type, int symmetryflag, InpMtx *mtxA,
   FrontMtx *Precond, DenseMtx *mtxX, DenseMtx *mtxB, int itermax,
   double convergetol, int msglvl, FILE *msgFile ) ;
\end{verbatim}
\index{tfqmrr@{\tt tfqmrr()}}
\par
This method solves a real linear system using TFQMR algorithm with right 
preconditioner. 
\par \noindent {\it Return codes:}
{\tt 1} is a normal return.  Otherwise, an error message is printed and 
the program exits.

%-----------------------------------------------------------------------
\item
\begin{verbatim}
int tfqmrl ( int n_matrixSize, int type, int symmetryflag, InpMtx *mtxA,
   FrontMtx *Precond, DenseMtx *mtxX, DenseMtx *mtxB, int itermax,
   double convergetol, int msglvl, FILE *msgFile ) ;
\end{verbatim}
\index{tfqmrl@{\tt tfqmrl()}}
\par
This method solves a real linear system using TFQMR algorithm with left
preconditioner. 
\par \noindent {\it Return codes:}
{\tt 1} is a normal return.  Otherwise, an error message is printed and 
the program exits.

%-----------------------------------------------------------------------
\item
\begin{verbatim}
int pcgr ( int n_matrixSize, int type, int symmetryflag, InpMtx *mtxA,
   FrontMtx *Precond, DenseMtx *mtxX, DenseMtx *mtxB, int itermax,
   double convergetol, int msglvl, FILE *msgFile ) ;
\end{verbatim}
\index{pcgr@{\tt pcgr()}}
\par
This method solves a real symmetric position definite linear 
system using PCG algorithm with right preconditioner. 
\par \noindent {\it Return codes:}
{\tt 1} is a normal return.  Otherwise, an error message is printed and 
the program exits.

%-----------------------------------------------------------------------
\item
\begin{verbatim}
int pcgl ( int n_matrixSize, int type, int symmetryflag, InpMtx *mtxA,
   FrontMtx *Precond, DenseMtx *mtxX, DenseMtx *mtxB, int itermax,
   double convergetol, int msglvl, FILE *msgFile ) ;
\end{verbatim}
\index{pcgl@{\tt pcgl()}}
\par
This method solves a real symmetric position definite linear system 
using PCG algorithm with left preconditioner. 
\par \noindent {\it Return codes:}
{\tt 1} is a normal return.  Otherwise, an error message is printed and 
the program exits.

%-----------------------------------------------------------------------
\item
\begin{verbatim}
int bgmresr ( int n_matrixSize, int type, int symmetryflag, InpMtx *mtxA,
   FrontMtx *Precond, DenseMtx *mtxX, DenseMtx *mtxB, int maxnouter,
   int maxninner, int *pnouter, int *pninner, double convergetol, 
   int msglvl, FILE *msgFile ) ;
\end{verbatim}
\index{pcgl@{\tt pcgl()}}
\par
This method solves a real  linear system 
using BGMRES algorithm with right preconditioner. 
\par \noindent {\it Return codes:}
{\tt 1} is a normal return.  Otherwise, an error message is printed and 
the program exits.

%-----------------------------------------------------------------------
\item
\begin{verbatim}
int bgmresl ( int n_matrixSize, int type, int symmetryflag, InpMtx *mtxA,
   FrontMtx *Precond, DenseMtx *mtxX, DenseMtx *mtxB, int maxnouter,
   int maxninner, int *pnouter, int *pninner, double convergetol, 
   int msglvl, FILE *msgFile ) ;
\end{verbatim}
\index{pcgl@{\tt pcgl()}}
\par
This method solves a real  linear system 
using BGMRES algorithm with left preconditioner. 
\par \noindent {\it Return codes:}
{\tt 1} is a normal return.  Otherwise, an error message is printed and 
the program exits.

%-----------------------------------------------------------------------
\item
\begin{verbatim}
int zbicgstabr ( int n_matrixSize, int type, int symmetryflag, InpMtx *mtxA,
   FrontMtx *Precond, DenseMtx *mtxX, DenseMtx *mtxB, int itermax,
   double convergetol, int msglvl, FILE *msgFile ) ;
\end{verbatim}
\index{zbicgstabr@{\tt zbicgstabr()}}
\par
This method solves a complex linear system using BiCGStab algorithm with right 
preconditioner. 
\par \noindent {\it Return codes:}
{\tt 1} is a normal return.  Otherwise, an error message is printed and 
the program exits.


%-----------------------------------------------------------------------
\item
\begin{verbatim}
int zbicgstabl ( int n_matrixSize, int type, int symmetryflag, InpMtx *mtxA,
   FrontMtx *Precond, DenseMtx *mtxX, DenseMtx *mtxB, int itermax,
   double convergetol, int msglvl, FILE *msgFile ) ; 
\end{verbatim}
\index{zbicgstabl@{\tt zbicgstabl()}}
\par
This method solves a complex linear system using BiCGStab algorithm with left 
preconditioner. 
\par \noindent {\it Return codes:}
{\tt 1} is a normal return.  Otherwise, an error message is printed and 
the program exits.

%-----------------------------------------------------------------------
\item
\begin{verbatim}
int zmlbicgstabr ( int n_matrixSize, int type, int symmetryflag, InpMtx *mtxA,
   FrontMtx *Precond, DenseMtx *mtxX, DenseMtx *mtxQ, DenseMtx *mtxB,
   int itermax, double convergetol, int msglvl, FILE *msgFile ) ;
\end{verbatim}
\index{zmlbicgstabr@{\tt zmlbicgstabr()}}
\par
This method solves a complex linear system using MLBiCGStab algorithm with right 
preconditioner. 
\par \noindent {\it Return codes:}
{\tt 1} is a normal return.  Otherwise, an error message is printed and 
the program exits.

%-----------------------------------------------------------------------
\item
\begin{verbatim}
int zmlbicgstabl ( int n_matrixSize, int type, int symmetryflag, InpMtx *mtxA,
   FrontMtx *Precond, DenseMtx *mtxX, DenseMtx *mtxQ, DenseMtx *mtxB,
   int itermax, double convergetol, int msglvl, FILE *msgFile ) ;
\end{verbatim}
\index{zmlbicgstabl@{\tt zmlbicgstabl()}}
\par
This method solves a complex linear system using MLBiCGStab algorithm with left 
preconditioner. 
\par \noindent {\it Return codes:}
{\tt 1} is a normal return.  Otherwise, an error message is printed and 
the program exits.

%-----------------------------------------------------------------------
\item
\begin{verbatim}
int ztfqmrr ( int n_matrixSize, int type, int symmetryflag, InpMtx *mtxA,
   FrontMtx *Precond, DenseMtx *mtxX, DenseMtx *mtxB, int itermax,
   double convergetol, int msglvl, FILE *msgFile ) ;
\end{verbatim}
\index{ztfqmrr@{\tt ztfqmrr()}}
\par
This method solves a complex linear system using TFQMR algorithm with right 
preconditioner. 
\par \noindent {\it Return codes:}
{\tt 1} is a normal return.  Otherwise, an error message is printed and 
the program exits.

%-----------------------------------------------------------------------
\item
\begin{verbatim}
int ztfqmrl ( int n_matrixSize, int type, int symmetryflag, InpMtx *mtxA,
   FrontMtx *Precond, DenseMtx *mtxX, DenseMtx *mtxB, int itermax,
   double convergetol, int msglvl, FILE *msgFile ) ;
\end{verbatim}
\index{ztfqmrl@{\tt ztfqmrl()}}
\par
This method solves a complex linear system using TFQMR algorithm with left
preconditioner. 
\par \noindent {\it Return codes:}
{\tt 1} is a normal return.  Otherwise, an error message is printed and 
the program exits.

%-----------------------------------------------------------------------
\item
\begin{verbatim}
int zpcgr ( int n_matrixSize, int type, int symmetryflag, InpMtx *mtxA,
   FrontMtx *Precond, DenseMtx *mtxX, DenseMtx *mtxB, int itermax,
   double convergetol, int msglvl, FILE *msgFile ) ;
\end{verbatim}
\index{zpcgr@{\tt zpcgr()}}
\par
This method solves a complex hermitian position definite linear 
system using PCG algorithm with right preconditioner. 
\par \noindent {\it Return codes:}
{\tt 1} is a normal return.  Otherwise, an error message is printed and 
the program exits.

%-----------------------------------------------------------------------
\item
\begin{verbatim}
int zpcgl ( int n_matrixSize, int type, int symmetryflag, InpMtx *mtxA,
   FrontMtx *Precond, DenseMtx *mtxX, DenseMtx *mtxB, int itermax,
   double convergetol, int msglvl, FILE *msgFile ) ;
\end{verbatim}
\index{zpcgl@{\tt zpcgl()}}
\par
This method solves a complex hermitian position definite linear system 
using PCG algorithm with left preconditioner. 
\par \noindent {\it Return codes:}
{\tt 1} is a normal return.  Otherwise, an error message is printed and 
the program exits.

\end{enumerate}