File: proto.tex

package info (click to toggle)
spooles 2.2-11
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 19,656 kB
  • ctags: 3,690
  • sloc: ansic: 146,836; sh: 7,571; csh: 3,615; makefile: 1,968; perl: 74
file content (281 lines) | stat: -rw-r--r-- 10,197 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
\par
\section{Prototypes and descriptions of {\tt SemiImplMtx} methods}
\label{section:SemiImplMtx:proto}
\par
This section contains brief descriptions including prototypes
of all methods that belong to the {\tt SemiImplMtx} object.
\par
\subsection{Basic methods}
\label{subsection:SemiImplMtx:proto:basics}
\par
As usual, there are four basic methods to support object creation,
setting default fields, clearing any allocated data, and free'ing
the object.
\par
%=======================================================================
\begin{enumerate}
%-----------------------------------------------------------------------
\item
\begin{verbatim}
SemiImplMtx * SemiImplMtx_new ( void ) ;
\end{verbatim}
\index{SemiImplMtx_new@{\tt SemiImplMtx\_new()}}
This method simply allocates storage for the {\tt SemiImplMtx} 
structure and then sets the default fields by a call to 
{\tt SemiImplMtx\_setDefaultFields()}.
%-----------------------------------------------------------------------
\item
\begin{verbatim}
int SemiImplMtx_setDefaultFields ( SemiImplMtx *mtx ) ;
\end{verbatim}
\index{SemiImplMtx_setDefaultFields@{\tt SemiImplMtx\_setDefaultFields()}}
This method sets the structure's fields to default values:
{\tt neqns} = 0,
{\tt type} = {\tt SPOOLES\_REAL}, 
{\tt symmetryflag} = {\tt SPOOLES\_SYMMETRIC}, 
{\tt ndomeqns} = {\tt nschureqns} = 0,
and {\tt domainMtx}, {\tt schurMtx}, {\tt A21}, {\tt A12},
{\tt domRowsIV}, {\tt schurRowsIV},
{\tt domColumnsIV}  and {\tt schurColumnsIV} 
are all set to {\tt NULL}.
\par \noindent {\it Return codes:}
{\tt 1} means a normal return,
{\tt -1} means {\tt mtx} is {\tt NULL}.
%-----------------------------------------------------------------------
\item
\begin{verbatim}
int SemiImplMtx_clearData ( SemiImplMtx *mtx ) ;
\end{verbatim}
\index{SemiImplMtx_clearData@{\tt SemiImplMtx\_clearData()}}
This method releases all storage held by the object.
\par \noindent {\it Return codes:}
{\tt 1} means a normal return,
{\tt -1} means {\tt mtx} is {\tt NULL}.
%-----------------------------------------------------------------------
\item
\begin{verbatim}
int SemiImplMtx_free ( SemiImplMtx *mtx ) ;
\end{verbatim}
\index{SemiImplMtx_free@{\tt SemiImplMtx\_free()}}
This method releases all storage held by the object via a call to
{\tt SemiImplMtx\_clearData()}, then free'd the storage for the
object.
\par \noindent {\it Return codes:}
{\tt 1} means a normal return,
{\tt -1} means {\tt mtx} is {\tt NULL}.
%-----------------------------------------------------------------------
\end{enumerate}
\par
\subsection{Initialization Methods}
\label{subsection:SemiImplMtx:proto:initializers}
\par
%=======================================================================
\begin{enumerate}
%-----------------------------------------------------------------------
\item
\begin{verbatim}
int SemiImplMtx_initFromFrontMtx ( SemiImplMtx *semimtx, FrontMtx *frontmtx, 
                InpMtx *inpmtx, IV *frontmapIV, int msglvl, FILE *msgFile) ;
\end{verbatim}
\index{SemiImplMtx_initFromFrontMtx@{\tt SemiImplMtx\_initFromFrontMtx()}}
This initializer is used after the {\tt FrontMtx} object for the
factorization has been computed.
The {\tt frontmapIV} object defines which fronts map to domains
and which to the Schur complement.
If entry {\tt J} of the {\tt frontmapIV} object is zero, then front
{\tt J} belongs in the Schur complement, otherwise it belongs to
the domains' matrix.
The $A_{1,2}$ and $A_{2,1}$ (if nonsymmetric) matrices are
extracted from the {\tt InpMtx} object.
\par
The {\tt semimtx} object removes submatrices from the {\tt
frontmtx} object, i.e., after the return of this method,
the {\tt frontmtx} no longer owns (and so cannot free) the
submatrices from the $(1,1)$ and $(2,2)$ blocks.
On return, the {\tt frontmtx} object can safely be free'd
without affecting the {\tt semimtx} object.
\par \noindent {\it Return codes:}
\begin{center}
\begin{tabular}{rl}
 1 & normal return \\
-1 & {\tt semimtx} is {\tt NULL} \\
-2 & {\tt frontmtx} is {\tt NULL} \\
-3 & {\tt inpmtx} is {\tt NULL} \\
\end{tabular}
\quad
\begin{tabular}{rl}
-4 & {\tt frontmapIV} is {\tt NULL} \\
-5 & {\tt frontmapIV} is invalid \\
-6 & unable to create (1,1) front matrix \\
-7 & unable to create (2,2) front matrix \\
\end{tabular}
\end{center}
%-----------------------------------------------------------------------
\item
\begin{verbatim}
int FrontMtx_initFromSubMtx ( FrontMtx *submtx, FrontMtx *frontmtx, IV *frontidsIV,
                              IV *rowsIV, IV *colsIV, int msglvl, FILE *msgFile) ;
\end{verbatim}
\index{FrontMtx_initFromSubMtx@{\tt FrontMtx\_initFromSubMtx()}}
This initializer is used to initialize the {\tt submtx} {\tt
FrontMtx} object from a global {\tt FrontMtx} object,
i.e., to initialize the {\tt domainMtx} and {\tt schurMtx} objects.
The fronts of the {\tt frontmtx} that will be included into the
{\tt submtx} object are given in the {\tt frontidsIV} vector object.
The {\tt submtx} object extracts the submatrices from the {\tt
frontmtx} object, i.e., after the return of this method,
the {\tt frontmtx} no longer owns (and so cannot free) its
submatrices.
The {\tt submtx} front matrix has {\it local} numbering, 
its global row ids are placed in {\tt rowsIV} and 
its global column ids are placed in {\tt colsIV}.
\par \noindent {\it Return codes:}
\begin{center}
\begin{tabular}{rl}
~~1 & normal return \\
~-1 & {\tt submtx} is {\tt NULL} \\
~-2 & {\tt frontmtx} is {\tt NULL} \\
~-3 & {\tt frontmtx} is not in 2-d mode \\
~-4 & {\tt frontidsIV} is {\tt NULL} \\
~-5 & {\tt frontidsIV} is invalid \\
~-6 & {\tt rowsIV} is {\tt NULL} \\
\end{tabular}
\quad
\begin{tabular}{rl}
~-7 & {\tt colsIV} is {\tt NULL} \\
~-8 & unable to create the front tree \\
~-9 & unable to create the symbolic factorization \\
-10 & unable to create the column adjacency  \\
-11 & unable to create the row adjacency  \\
-12 & unable to create the upper block {\tt IVL}  \\
-13 & unable to create the lower block {\tt IVL}  \\
\end{tabular}
\end{center}
\end{enumerate}
\par
%=======================================================================
\par
\subsection{Solve Methods}
\label{subsection:SemiImplMtx:proto:solve}
\par
%=======================================================================
\begin{enumerate}
%-----------------------------------------------------------------------
\item
\begin{verbatim}
int SemiImplMtx_solve ( SemiImplMtx *mtx, DenseMtx *X, DenseMtx *B, 
         SubMtxManager *mtxmanager, double cpus[], int msglvl, FILE  *msgFile ) ;
\end{verbatim}
\index{SemiImplMtx_solve@{\tt SemiImplMtx\_solve()}}
This methods solves a linear system
$(L + I)D(I + U)X = B$, $(U^T + I)D(I + U)X = B$ or
$(U^H + I)D(I + U)X = B$,
where {\tt X} and {\tt B} are {\tt DenseMtx} objects.
{\tt mtxmanager} is an object to handle the working
{\tt SubMtx} objects during the solve.
One can have {\tt X} and {\tt B} point to the same object,
for entries are read from {\tt B} and written to {\tt X}.
On return, the {\tt cpus[]} vector contains the following
information.
\begin{center}
\begin{tabular}{rl}
{\tt cpus[0]} & initialize working matrices \\
{\tt cpus[1]} & load right hand side \\
{\tt cpus[2]} & first solve with domains \\
{\tt cpus[3]} & compute Schur right hand side \\
{\tt cpus[4]} & Schur solve
\end{tabular}
\quad
\begin{tabular}{rl}
{\tt cpus[5]} & compute domains' right hand side \\
{\tt cpus[6]} & second solve with domains \\
{\tt cpus[7]} & store solution \\
{\tt cpus[8]} & miscellaneous time \\
{\tt cpus[9]} & total time
\end{tabular}
\end{center}
\par \noindent {\it Return codes:}
\begin{center}
\begin{tabular}{rl}
 1 & normal return \\
-1 & {\tt mtx} is {\tt NULL} \\
-2 & {\tt X} is {\tt NULL} \\
\end{tabular}
\quad
\begin{tabular}{rl}
-3 & {\tt B} is {\tt NULL} \\
-4 & {\tt mtxmanager} is {\tt NULL} \\
-5 & {\tt cpus} is {\tt NULL} \\
\end{tabular}
\end{center}
\end{enumerate}
\par
%=======================================================================
\subsection{Utility methods}
\label{subsection:SemiImplMtx:proto:utility}
\par
\begin{enumerate}
%-----------------------------------------------------------------------
\item
\begin{verbatim}
int SemiImplMtx_stats ( SemiImplMtx *mtx, int stats[] ) ;
\end{verbatim}
\index{SemiImplMtx_stats@{\tt SemiImplMtx\_stats()}}
This method fills the {\tt stats[]} vector with some statistics.
\begin{center}
\begin{tabular}[t]{rl}
{\tt stats[0]} & \# of equations \\
{\tt stats[1]} & \# of equations in the $(1,1)$ block \\
{\tt stats[2]} & \# of equations in the $(2,2)$ block \\
{\tt stats[3]} & \# of entries in $L_{1,1}$ \\
{\tt stats[4]} & \# of entries in $D_{1,1}$ \\
{\tt stats[5]} & \# of entries in $U_{1,1}$ \\
{\tt stats[6]} & \# of entries in $L_{2,2}$ \\
\end{tabular}
\quad
\begin{tabular}[t]{rl}
{\tt stats[7]} & \# of entries in $D_{2,2}$ \\
{\tt stats[8]} & \# of entries in $U_{2,2}$ \\
{\tt stats[9]} & \# of entries in $A_{1,2}$ \\
{\tt stats[10]} & \# of entries in $A_{2,1}$ \\
{\tt stats[11]} & total \# of entries \\
{\tt stats[12]} & \# of operations for a solve 
\end{tabular}
\end{center}
\par \noindent {\it Return values:}
\par
{\tt 1} for a normal return,
{\tt -1} if {\tt mtx} is {\tt NULL},
{\tt -2} if {\tt stats} is {\tt NULL}.
%-----------------------------------------------------------------------
\end{enumerate}
\par
\subsection{IO methods}
\label{subsection:SemiImplMtx:proto:IO}
\par
%=======================================================================
\begin{enumerate}
%-----------------------------------------------------------------------
\item
\begin{verbatim}
int SemiImplMtx_writeForHumanEye ( SemiImplMtx *mtx, FILE *fp ) ;
\end{verbatim}
\index{SemiImplMtx_writeForHumanEye@{\tt SemiImplMtx\_writeForHumanEye()}}
\par
This method writes out a {\tt SemiImplMtx} object to a file in a 
human readable format.
\par \noindent {\it Return codes:}
\begin{center}
\begin{tabular}{rl}
 1 & normal return \\
-1 & {\tt mtx} is {\tt NULL} \\
-2 & {\tt type} is invalid \\
\end{tabular}
\quad
\begin{tabular}{rl}
-3 & {\tt symmetryflag} is invalid \\
-4 & {\tt fp} is {\tt NULL}
\end{tabular}
\end{center}
%-----------------------------------------------------------------------
\end{enumerate}