/usr/include/spooles/ILUMtx/ILUMtx.h is in libspooles-dev 2.2-9.
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 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 | /* ILUMtx.h */
#include "../InpMtx.h"
/*--------------------------------------------------------------------*/
/*
--------------------------------------------------------------------
the ILUMtx is used to compute, store and solve with a factorization
of the form A = (L+I)D(I+U), (U^T+I)D(I+U) or (U^H+I)D(I+U).
the factorization is very simple, stored by vectors, and can
be exact (up to roundoff) or approximate. it is a less
complicated alternative to the FrontMtx object.
neqns - # of equations
type - SPOOLES_INDICES_ONLY, SPOOLES_REAL or SPOOLES_COMPLEX
symmetryflag - SPOOLES_SYMMETRIC, SPOOLES_HERMITIAN
or SPOOLES_COMPLEX
UstorageMode -- storage mode for U
SPOOLES_BY_ROWS or SPOOLES_BY_COLUMNS
LstorageMode -- storage mode for L
SPOOLES_BY_ROWS or SPOOLES_BY_COLUMNS
sizesL -- vector of sizes of the L vectors
sizesU -- vector of sizes of the U vectors
p_indL -- vector of pointers to indices of the L vectors
p_indU -- vector of pointers to indices of the U vectors
entD -- vector of entries in D
p_entL -- vector of pointers to entries of the L vectors
p_entU -- vector of pointers to entries of the U vectors
created -- 98oct03, cca
--------------------------------------------------------------------
*/
typedef struct _ILUMtx ILUMtx ;
struct _ILUMtx {
int neqns ;
int type ;
int symmetryflag ;
int UstorageMode ;
int LstorageMode ;
int *sizesL ;
int *sizesU ;
int **p_indL ;
int **p_indU ;
double *entD ;
double **p_entL ;
double **p_entU ;
} ;
/*--------------------------------------------------------------------*/
/*
------------
handy macros
------------
*/
#define ILUMTX_IS_REAL(mtx) ((mtx)->type == SPOOLES_REAL)
#define ILUMTX_IS_COMPLEX(mtx) ((mtx)->type == SPOOLES_COMPLEX)
#define ILUMTX_IS_SYMMETRIC(mtx) \
((mtx)->symmetryflag == SPOOLES_SYMMETRIC)
#define ILUMTX_IS_HERMITIAN(mtx) \
((mtx)->symmetryflag == SPOOLES_HERMITIAN)
#define ILUMTX_IS_NONSYMMETRIC(mtx) \
((mtx)->symmetryflag == SPOOLES_NONSYMMETRIC)
#define ILUMTX_IS_L_BY_ROWS(mtx) \
((mtx)->LstorageMode == SPOOLES_BY_ROWS)
#define ILUMTX_IS_L_BY_COLUMNS(mtx) \
((mtx)->LstorageMode == SPOOLES_BY_COLUMNS)
#define ILUMTX_IS_U_BY_ROWS(mtx) \
((mtx)->UstorageMode == SPOOLES_BY_ROWS)
#define ILUMTX_IS_U_BY_COLUMNS(mtx) \
((mtx)->UstorageMode == SPOOLES_BY_COLUMNS)
/*--------------------------------------------------------------------*/
/*
------------------------------------------------------------------------
----- methods found in basics.c ----------------------------------------
------------------------------------------------------------------------
*/
/*
-----------------------
simplest constructor
created -- 98oct03, cca
-----------------------
*/
ILUMtx *
ILUMtx_new (
void
) ;
/*
-----------------------
set the default fields
return code --
1 -- normal return
-1 -- mtx is NULL
created -- 98oct03, cca
-----------------------
*/
int
ILUMtx_setDefaultFields (
ILUMtx *mtx
) ;
/*
--------------------------------------------------
clear the data fields, releasing allocated storage
return code --
1 -- normal return
-1 -- mtx is NULL
created -- 98oct03, cca
--------------------------------------------------
*/
int
ILUMtx_clearData (
ILUMtx *mtx
) ;
/*
------------------------------------------
destructor, free's the object and its data
return code --
1 -- normal return
-1 -- mtx is NULL
created -- 98oct03, cca
------------------------------------------
*/
int
ILUMtx_free (
ILUMtx *mtx
) ;
/*--------------------------------------------------------------------*/
/*
------------------------------------------------------------------------
----- methods found in init.c ------------------------------------------
------------------------------------------------------------------------
*/
/*
---------------------------------------------
purpose -- initialize the ILUMtx object
return values ---
1 -- normal return
-1 -- mtx is NULL
-2 -- neqns <= 0
-3 -- bad type for mtx
-4 -- bad symmetryflag for mtx
-5 -- storage mode of L is invalid
-6 -- storage mode of U is invalid
-7 -- matrix is symmetric or hermitian
and storage modes are not compatible
created -- 98oct03, cca
---------------------------------------------
*/
int
ILUMtx_init (
ILUMtx *mtx,
int neqns,
int type,
int symmetryflag,
int LstorageMode,
int UstorageMode
) ;
/*--------------------------------------------------------------------*/
/*
------------------------------------------------------------------------
----- methods found in factor.c ----------------------------------------
------------------------------------------------------------------------
*/
/*
-------------------------------------------------------------------
purpose -- to factor the linear system
A = (L + I)D(I + U), A = (U^T + I)D(I + U) or
A = (U^H + I)D(I + U).
if pops is not NULL, then on return *pops has been incremented
by the number of operations performed in the solve.
return values ---
1 -- normal return
-1 -- mtx is NULL
-2 -- neqns <= 0
-3 -- bad type for mtxLDU
-4 -- bad symmetryflag for mtxLDU
-5 -- storage mode of L is invalid
-6 -- storage mode of U is invalid
-7 -- sizesL is NULL
-8 -- sizesU is NULL
-9 -- p_indL is NULL
-10 -- p_indU is NULL
-11 -- entD is NULL
-12 -- p_entL is NULL
-13 -- p_entU is NULL
-14 -- mtxA is NULL
-15 -- types of mtxLDU and mtxA are not the same
-16 -- mtxA is not in chevron mode
-17 -- droptol < 0.0
-18 -- msglvl > 0 and msgFile is NULL
-19 -- singular pivot found
created -- 98oct03, cca
-------------------------------------------------------------------
*/
int
ILUMtx_factor (
ILUMtx *mtxLDU,
InpMtx *mtxA,
double droptol,
double *pops,
int msglvl,
FILE *msgFile
) ;
/*--------------------------------------------------------------------*/
/*
------------------------------------------------------------------------
----- methods found in solve.c -----------------------------------------
------------------------------------------------------------------------
*/
/*
-------------------------------------------------------------------
purpose -- to solve the 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. X and B are single vectors.
workDV is a temporary vector.
note, if workDV is different than B, then B is unchanged on return.
one can have X, B and workDV all point to the same object.
if pops is not NULL, then on return *pops has been incremented
by the number of operations performed in the solve.
return values ---
1 -- normal return
-1 -- LDU is NULL
-2 -- neqns <= 0
-3 -- bad type for LDU
-4 -- bad symmetryflag for LDU
-5 -- storage mode of L is invalid
-6 -- storage mode of U is invalid
-7 -- sizesL is NULL
-8 -- sizesU is NULL
-9 -- p_indL is NULL
-10 -- p_indU is NULL
-11 -- entD is NULL
-12 -- p_entL is NULL
-13 -- p_entU is NULL
-14 -- X is NULL
-15 -- size of X is incorrect
-16 -- entries of X are NULL
-17 -- B is NULL
-18 -- size of B is incorrect
-19 -- entries of B are NULL
-20 -- workDV is NULL
-21 -- size of workDV != neqns
-22 -- entries of workDV are NULL
-23 -- msglvl > 0 and msgFile is NULL
created -- 98oct03, cca
-------------------------------------------------------------------
*/
int
ILUMtx_solveVector (
ILUMtx *LDU,
DV *X,
DV *B,
DV *workDV,
double *pops,
int msglvl,
FILE *msgFile
) ;
/*--------------------------------------------------------------------*/
/*
------------------------------------------------------------------------
----- methods found in misc.c ------------------------------------------
------------------------------------------------------------------------
*/
/*
-------------------------------------------------------------
purpose -- to fill the indices and entries with random values
return values ---
1 -- normal return
-1 -- mtx is NULL
-2 -- neqns <= 0
-3 -- bad type for mtx
-4 -- bad symmetryflag for mtx
-5 -- storage mode of L is invalid
-6 -- storage mode of U is invalid
-7 -- sizesL is NULL
-8 -- sizesU is NULL
-9 -- p_indL is NULL
-10 -- p_indU is NULL
-11 -- entD is NULL
-12 -- p_entL is NULL
-13 -- p_entU is NULL
created -- 98oct03, cca
-------------------------------------------------------------
*/
int
ILUMtx_fillRandom (
ILUMtx *mtx,
int seed
) ;
/*--------------------------------------------------------------------*/
/*
------------------------------------------------------------------------
----- methods found in IO.c --------------------------------------------
------------------------------------------------------------------------
*/
/*
---------------------------------------------------------------
purpose -- to write an ILUMtx object to a file in matlab format
return values ---
1 -- normal return
-1 -- mtx is NULL
-2 -- neqns <= 0
-3 -- bad type for LDU
-4 -- bad symmetryflag for LDU
-5 -- bad LstorageMode for LDU
-6 -- bad UstorageMode for LDU
-7 -- sizesL is NULL
-8 -- sizesU is NULL
-9 -- p_indL is NULL
-10 -- p_indU is NULL
-11 -- entD is NULL
-12 -- p_entL is NULL
-13 -- p_entU is NULL
-14 -- Lname is NULL
-15 -- Dname is NULL
-16 -- Uname is NULL
-17 -- fp is NULL
created -- 98oct03, cca
---------------------------------------------------------------
*/
int
ILUMtx_writeForMatlab (
ILUMtx *mtx,
char *Lname,
char *Dname,
char *Uname,
FILE *fp
) ;
/*--------------------------------------------------------------------*/
|