2
* -- Auxiliary routine in SuperLU (version 2.0) --
3
* Lawrence Berkeley National Lab, Univ. of California Berkeley.
12
void dGetDiagU(SuperMatrix *L, double *diagU)
18
* GetDiagU extracts the main diagonal of matrix U of the LU factorization.
23
* L (input) SuperMatrix*
24
* The factor L from the factorization Pr*A*Pc=L*U as computed by
25
* dgstrf(). Use compressed row subscripts storage for supernodes,
26
* i.e., L has types: Stype = SLU_SC, Dtype = SLU_D, Mtype = SLU_TRLU.
28
* diagU (output) double*, dimension (n)
29
* The main diagonal of matrix U.
33
* The diagonal blocks of the L and U matrices are stored in the L
38
int_t fsupc, nsupr, nsupc, luptr;
39
double *dblock, *Lval;
44
nsupers = Lstore->nsuper + 1;
46
for (k = 0; k < nsupers; ++k) {
47
fsupc = L_FST_SUPC(k);
48
nsupc = L_FST_SUPC(k+1) - fsupc;
49
nsupr = L_SUB_START(fsupc+1) - L_SUB_START(fsupc);
50
luptr = L_NZ_START(fsupc);
52
dblock = &diagU[fsupc];
53
for (i = 0; i < nsupc; ++i) {
54
dblock[i] = Lval[luptr];