1
/* ========================================================================== */
2
/* === UMF_blas3_update ===================================================== */
3
/* ========================================================================== */
5
/* -------------------------------------------------------------------------- */
6
/* UMFPACK Version 4.1 (Apr. 30, 2003), Copyright (c) 2003 by Timothy A. */
7
/* Davis. All Rights Reserved. See ../README for License. */
8
/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
9
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
10
/* -------------------------------------------------------------------------- */
12
#include "umf_internal.h"
14
GLOBAL void UMF_blas3_update
19
/* ---------------------------------------------------------------------- */
21
/* ---------------------------------------------------------------------- */
23
Entry *L, *U, *C, *LU ;
24
Int k, m, n, d, nb, dc ;
26
DEBUG5 (("In UMF_blas3_update "ID" "ID" "ID"\n",
27
Work->fnpiv, Work->fnrows, Work->fncols)) ;
42
ASSERT (d >= 0 && (d % 2) == 1) ;
43
C = Work->Fcblock ; /* ldc is fnr_curr */
44
L = Work->Flblock ; /* ldl is fnr_curr */
45
U = Work->Fublock ; /* ldu is fnc_curr, stored by rows */
46
LU = Work->Flublock ; /* nb-by-nb */
49
DEBUG5 (("DO RANK-NB UPDATE of frontal:\n")) ;
50
DEBUG5 (("DGEMM : "ID" "ID" "ID"\n", k, m, n)) ;
51
DEBUG7 (("C block: ")) ; UMF_dump_dense (C, d, m, n) ;
52
DEBUG7 (("A block: ")) ; UMF_dump_dense (L, d, m, k) ;
53
DEBUG7 (("B' block: ")) ; UMF_dump_dense (U, dc, n, k) ;
54
DEBUG7 (("LU block: ")) ; UMF_dump_dense (LU, nb, k, k) ;
62
/* no BLAS available - use plain C code instead */
65
/* rank-1 outer product to update the C block */
66
for (j = 0 ; j < n ; j++)
75
for (i = 0 ; i < m ; i++)
77
/* C [i+j*d]-= L [i] * U [j] */
78
MULT_SUB (*c_ij, *l_is, u_j) ;
86
BLAS_GER (m, n, L, U, C, d) ;
88
#endif /* USE_NO_BLAS */
96
/* no BLAS available - use plain C code instead */
99
/* triangular solve to update the U block */
100
for (s = 0 ; s < k ; s++)
102
for (i = s+1 ; i < k ; i++)
104
Entry l_is = LU [i+s*nb] ;
105
if (IS_NONZERO (l_is))
111
for (j = 0 ; j < n ; j++)
113
/* U [i*dc+j] -= LU [i+s*nb] * U [s*dc+j] ; */
114
MULT_SUB (*u_ij, l_is, *u_sj) ;
122
/* rank-k outer product to update the C block */
123
/* C = C - L*U' (U is stored by rows, not columns) */
124
for (s = 0 ; s < k ; s++)
126
for (j = 0 ; j < n ; j++)
128
Entry u_sj = U [j+s*dc] ;
129
if (IS_NONZERO (u_sj))
135
for (i = 0 ; i < m ; i++)
137
/* C [i+j*d]-= L [i+s*d] * U [s*dc+j] */
138
MULT_SUB (*c_ij, *l_is, u_sj) ;
148
BLAS_TRSM_RIGHT (n, k, LU, nb, U, dc) ;
149
BLAS_GEMM (m, n, k, L, U, dc, C, d) ;
151
#endif /* USE_NO_BLAS */
156
DEBUG5 (("RANK-NB UPDATE of frontal done:\n")) ;
157
DEBUG5 (("DGEMM : "ID" "ID" "ID"\n", k, m, n)) ;
158
DEBUG7 (("C block: ")) ; UMF_dump_dense (C, d, m, n) ;
159
DEBUG7 (("A block: ")) ; UMF_dump_dense (L, d, m, k) ;
160
DEBUG7 (("B' block: ")) ; UMF_dump_dense (U, dc, n, k) ;
161
DEBUG7 (("LU block: ")) ; UMF_dump_dense (LU, nb, k, k) ;
164
DEBUG2 (("blas3 "ID" "ID" "ID"\n", k, Work->fnrows, Work->fncols)) ;