/usr/include/spooles/SemiImplMtx/SemiImplMtx.h is in libspooles-dev 2.2-10build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 | /* SemiImplMtx.h */
#include "../FrontMtx.h"
/*--------------------------------------------------------------------*/
/*
----------------------------------------------------------------
the SemiImplMtx object is used to perform "semi-implicit solves"
of the following matrix factorization.
A = P [ A11 A12 ] Q = P [ L11 0 ] [ D11 0 ] [ U11 U12 ] Q
[ A21 A22 ] [ L21 L22 ] [ 0 D22 ] [ 0 U22 ]
where P and Q are chosen by pivoting for stability.
the semi-implicit factorization drops L21 and U12, and trades
operating with them with multiplies by A21 and A12 and extra
solves involving A11.
we want to solve [ A11 A12 ] [ X1 ] = [ B1 ]
[ A21 A22 ] [ X2 ] = [ B2 ]
this can be done explicitly, as
1. solve L11 Y1 = B1
2. solve L22 Y2 = B2 - L21 Y1
3. solve D11 Z1 = Y1
4. solve D22 Z2 = Y2
5. solve U22 X2 = Z2
6. solve U11 X1 = Z1 - U12 X2
or implicitly, as
1. solve L11 D11 U11 T = B1
2. solve L22 D22 U22 X2 = B2 - A21 T
3. solve L11 D11 U11 T = B1 - A12 X2
neqns -- # of equations
type -- type of entries
1 (SPOOLES_REAL) -- real entries
2 (SPOOLES_COMPLEX) -- complex entries
symmetryflag -- symmetry type
0 (SPOOLES_SYMMETRIC) -- symmetric matrix
1 (SPOOLES_HERMITIAN) -- hermitian matrix
2 (SPOOLES_NONSYMMETRIC) -- nonsymmetric matrix
ndomeqns -- # of equations in the domains
nschureqns -- # of equations in the schur complement
domainMtx -- pointer to FrontMtx objec that holds
the factorization of A11
schurMtx -- pointer to FrontMtx objec that holds
the factorization of A22 - A21 * A11^{-1} * A12
domRowsIV -- vector of global ids of rows of A11
schurRowsIV -- vector of global ids of rows of A22
domColsIV -- vector of global ids of columns of A11
schurColsIV -- vector of global ids of columns of A22
created -- 98sep14
----------------------------------------------------------------
*/
typedef struct _SemiImplMtx SemiImplMtx ;
struct _SemiImplMtx {
int neqns ;
int type ;
int symmetryflag ;
int ndomeqns ;
int nschureqns ;
FrontMtx *domainMtx ;
FrontMtx *schurMtx ;
InpMtx *A21 ;
InpMtx *A12 ;
IV *domRowsIV ;
IV *schurRowsIV ;
IV *domColsIV ;
IV *schurColsIV ;
} ;
/*--------------------------------------------------------------------*/
/*
------------------------------------------------------------------------
----- methods found in basics.c ----------------------------------------
------------------------------------------------------------------------
*/
/*
-----------------------
simplest constructor
created -- 98oct16, cca
-----------------------
*/
SemiImplMtx *
SemiImplMtx_new (
void
) ;
/*
-----------------------
set the default fields
return code --
1 -- normal return
-1 -- mtx is NULL
created -- 98oct16, cca
-----------------------
*/
int
SemiImplMtx_setDefaultFields (
SemiImplMtx *mtx
) ;
/*
--------------------------------------------------
clear the data fields, releasing allocated storage
return code --
1 -- normal return
-1 -- mtx is NULL
created -- 98oct16, cca
--------------------------------------------------
*/
int
SemiImplMtx_clearData (
SemiImplMtx *mtx
) ;
/*
------------------------------------------
destructor, free's the object and its data
return code --
1 -- normal return
-1 -- mtx is NULL
created -- 98oct16, cca
------------------------------------------
*/
int
SemiImplMtx_free (
SemiImplMtx *mtx
) ;
/*--------------------------------------------------------------------*/
/*
------------------------------------------------------------------------
----- methods found in init.c ------------------------------------------
------------------------------------------------------------------------
*/
/*
------------------------------------------------------------------
purpose -- to initialize the semi-implicit matrix using as input a
FrontMtx and a map from fronts to domains (map[J] != 0)
or the schur complement (map[J] = 0)
return value --
1 -- normal return
-1 -- semimtx is NULL
-2 -- frontmtx is NULL
-3 -- inpmtx is NULL
-4 -- frontmapIV is NULL
-5 -- frontmapIV is invalid
created -- 98oct17, cca
------------------------------------------------------------------
*/
int
SemiImplMtx_initFromFrontMtx (
SemiImplMtx *semimtx,
FrontMtx *frontmtx,
InpMtx *inpmtx,
IV *frontmapIV,
int msglvl,
FILE *msgFile
) ;
/*
*/
int
FrontMtx_initFromSubmatrix (
FrontMtx *submtx,
FrontMtx *frontmtx,
IV *frontidsIV,
IV *rowsIV,
IV *colsIV,
int msglvl,
FILE *msgFile
) ;
/*--------------------------------------------------------------------*/
/*
------------------------------------------------------------------------
----- methods found in solve.c -----------------------------------------
------------------------------------------------------------------------
*/
/*
------------------------------------------------
purpose -- to solve the linear system A X = B
using a semi-implicit factorization
on return ---
cpus[0] -- time to initialize working matrices
cpus[1] -- time to load rhs
cpus[2] -- time for first solve with domains
cpus[3] -- time to compute schur rhs
cpus[4] -- time for schur solve
cpus[5] -- time to compute domains' rhs
cpus[6] -- time for second solve with domains
cpus[7] -- time to store solution
cpus[8] -- miscellaneous time
cpus[9] -- total time
return value --
1 -- normal return
-1 -- semimtx is NULL
-2 -- mtxX is NULL
-3 -- mtxB is NULL
-4 -- mtxmanager is NULL
-5 -- cpus is NULL
created -- 98oct17, cca
------------------------------------------------
*/
int
SemiImplMtx_solve (
SemiImplMtx *semimtx,
DenseMtx *mtxX,
DenseMtx *mtxB,
SubMtxManager *mtxmanager,
double cpus[],
int msglvl,
FILE *msgFile
) ;
/*--------------------------------------------------------------------*/
/*
------------------------------------------------------------------------
----- methods found in util.c ------------------------------------------
------------------------------------------------------------------------
*/
/*
---------------------------------------------------------
fill a statistics array for a semi-implicit factorization
stats[0] -- # of equations
stats[1] -- # of equations in the (1,1) block
stats[2] -- # of equations in the (2,2) block
stats[3] -- # of entries in L11
stats[4] -- # of entries in D11
stats[5] -- # of entries in U11
stats[6] -- # of entries in L22
stats[7] -- # of entries in D22
stats[8] -- # of entries in U22
stats[9] -- # of entries in A12
stats[10] -- # of entries in A21
stats[11] -- total # of matrix entries
stats[12] -- # of operations for a solve
return value ---
1 -- normal return
-1 -- semimtx is NULL
-2 -- stats is NULL
created -- 98oct22, cca
---------------------------------------------------------
*/
int
SemiImplMtx_stats (
SemiImplMtx *semimtx,
int stats[]
) ;
/*--------------------------------------------------------------------*/
/*
------------------------------------------------------------------------
----- methods found in IO.c --------------------------------------------
------------------------------------------------------------------------
*/
/*
-------------------------------------------
purpose -- to write a SemiImplMtx to a file
in a human readable format
return values ---
1 -- normal return
-1 -- mtx is NULL
-2 -- type is invalid
-3 -- symmetry flag is invalid
-4 -- fp is NULL
created -- 98oct16, cca
-------------------------------------------
*/
int
SemiImplMtx_writeForHumanEye (
SemiImplMtx *mtx,
FILE *fp
) ;
/*--------------------------------------------------------------------*/
|