1
/* -- translated by f2c (version 20100827).
2
You must link the resulting object file with libf2c:
3
on Microsoft Windows system, link with libf2c.lib;
4
on Linux or Unix systems, link with .../path/to/libf2c.a -lm
5
or, if you install libf2c.a in a standard place, with -lf2c -lm
6
-- in that order, at the end of the command line, as in
8
Source for libf2c is in /netlib/f2c/libf2c.zip, e.g.,
10
http://www.netlib.org/f2c/libf2c.zip
15
/* Subroutine */ int igraphdtrmm_(char *side, char *uplo, char *transa, char *diag,
16
integer *m, integer *n, doublereal *alpha, doublereal *a, integer *
17
lda, doublereal *b, integer *ldb)
19
/* System generated locals */
20
integer a_dim1, a_offset, b_dim1, b_offset, i__1, i__2, i__3;
23
integer i__, j, k, info;
26
extern logical igraphlsame_(char *, char *);
29
extern /* Subroutine */ int igraphxerbla_(char *, integer *, ftnlen);
36
DTRMM performs one of the matrix-matrix operations
38
B := alpha*op( A )*B, or B := alpha*B*op( A ),
40
where alpha is a scalar, B is an m by n matrix, A is a unit, or
41
non-unit, upper or lower triangular matrix and op( A ) is one of
43
op( A ) = A or op( A ) = A**T.
49
On entry, SIDE specifies whether op( A ) multiplies B from
50
the left or right as follows:
52
SIDE = 'L' or 'l' B := alpha*op( A )*B.
54
SIDE = 'R' or 'r' B := alpha*B*op( A ).
59
On entry, UPLO specifies whether the matrix A is an upper or
60
lower triangular matrix as follows:
62
UPLO = 'U' or 'u' A is an upper triangular matrix.
64
UPLO = 'L' or 'l' A is a lower triangular matrix.
69
On entry, TRANSA specifies the form of op( A ) to be used in
70
the matrix multiplication as follows:
72
TRANSA = 'N' or 'n' op( A ) = A.
74
TRANSA = 'T' or 't' op( A ) = A**T.
76
TRANSA = 'C' or 'c' op( A ) = A**T.
81
On entry, DIAG specifies whether or not A is unit triangular
84
DIAG = 'U' or 'u' A is assumed to be unit triangular.
86
DIAG = 'N' or 'n' A is not assumed to be unit
92
On entry, M specifies the number of rows of B. M must be at
97
On entry, N specifies the number of columns of B. N must be
101
ALPHA - DOUBLE PRECISION.
102
On entry, ALPHA specifies the scalar alpha. When alpha is
103
zero then A is not referenced and B need not be set before
107
A - DOUBLE PRECISION array of DIMENSION ( LDA, k ), where k is m
108
when SIDE = 'L' or 'l' and is n when SIDE = 'R' or 'r'.
109
Before entry with UPLO = 'U' or 'u', the leading k by k
110
upper triangular part of the array A must contain the upper
111
triangular matrix and the strictly lower triangular part of
113
Before entry with UPLO = 'L' or 'l', the leading k by k
114
lower triangular part of the array A must contain the lower
115
triangular matrix and the strictly upper triangular part of
117
Note that when DIAG = 'U' or 'u', the diagonal elements of
118
A are not referenced either, but are assumed to be unity.
122
On entry, LDA specifies the first dimension of A as declared
123
in the calling (sub) program. When SIDE = 'L' or 'l' then
124
LDA must be at least max( 1, m ), when SIDE = 'R' or 'r'
125
then LDA must be at least max( 1, n ).
128
B - DOUBLE PRECISION array of DIMENSION ( LDB, n ).
129
Before entry, the leading m by n part of the array B must
130
contain the matrix B, and on exit is overwritten by the
134
On entry, LDB specifies the first dimension of B as declared
135
in the calling (sub) program. LDB must be at least
142
Level 3 Blas routine.
144
-- Written on 8-February-1989.
145
Jack Dongarra, Argonne National Laboratory.
146
Iain Duff, AERE Harwell.
147
Jeremy Du Croz, Numerical Algorithms Group Ltd.
148
Sven Hammarling, Numerical Algorithms Group Ltd.
150
=====================================================================
153
Test the input parameters.
155
Parameter adjustments */
157
a_offset = 1 + a_dim1;
160
b_offset = 1 + b_dim1;
164
lside = igraphlsame_(side, "L");
170
nounit = igraphlsame_(diag, "N");
171
upper = igraphlsame_(uplo, "U");
174
if (! lside && ! igraphlsame_(side, "R")) {
176
} else if (! upper && ! igraphlsame_(uplo, "L")) {
178
} else if (! igraphlsame_(transa, "N") && ! igraphlsame_(transa,
179
"T") && ! igraphlsame_(transa, "C")) {
181
} else if (! igraphlsame_(diag, "U") && ! igraphlsame_(diag,
188
} else if (*lda < max(1,nrowa)) {
190
} else if (*ldb < max(1,*m)) {
194
igraphxerbla_("DTRMM ", &info, (ftnlen)6);
198
/* Quick return if possible. */
200
if (*m == 0 || *n == 0) {
204
/* And when alpha.eq.zero. */
208
for (j = 1; j <= i__1; ++j) {
210
for (i__ = 1; i__ <= i__2; ++i__) {
211
b[i__ + j * b_dim1] = 0.;
219
/* Start the operations. */
222
if (igraphlsame_(transa, "N")) {
224
/* Form B := alpha*A*B. */
228
for (j = 1; j <= i__1; ++j) {
230
for (k = 1; k <= i__2; ++k) {
231
if (b[k + j * b_dim1] != 0.) {
232
temp = *alpha * b[k + j * b_dim1];
234
for (i__ = 1; i__ <= i__3; ++i__) {
235
b[i__ + j * b_dim1] += temp * a[i__ + k *
240
temp *= a[k + k * a_dim1];
242
b[k + j * b_dim1] = temp;
250
for (j = 1; j <= i__1; ++j) {
251
for (k = *m; k >= 1; --k) {
252
if (b[k + j * b_dim1] != 0.) {
253
temp = *alpha * b[k + j * b_dim1];
254
b[k + j * b_dim1] = temp;
256
b[k + j * b_dim1] *= a[k + k * a_dim1];
259
for (i__ = k + 1; i__ <= i__2; ++i__) {
260
b[i__ + j * b_dim1] += temp * a[i__ + k *
272
/* Form B := alpha*A**T*B. */
276
for (j = 1; j <= i__1; ++j) {
277
for (i__ = *m; i__ >= 1; --i__) {
278
temp = b[i__ + j * b_dim1];
280
temp *= a[i__ + i__ * a_dim1];
283
for (k = 1; k <= i__2; ++k) {
284
temp += a[k + i__ * a_dim1] * b[k + j * b_dim1];
287
b[i__ + j * b_dim1] = *alpha * temp;
294
for (j = 1; j <= i__1; ++j) {
296
for (i__ = 1; i__ <= i__2; ++i__) {
297
temp = b[i__ + j * b_dim1];
299
temp *= a[i__ + i__ * a_dim1];
302
for (k = i__ + 1; k <= i__3; ++k) {
303
temp += a[k + i__ * a_dim1] * b[k + j * b_dim1];
306
b[i__ + j * b_dim1] = *alpha * temp;
314
if (igraphlsame_(transa, "N")) {
316
/* Form B := alpha*B*A. */
319
for (j = *n; j >= 1; --j) {
322
temp *= a[j + j * a_dim1];
325
for (i__ = 1; i__ <= i__1; ++i__) {
326
b[i__ + j * b_dim1] = temp * b[i__ + j * b_dim1];
330
for (k = 1; k <= i__1; ++k) {
331
if (a[k + j * a_dim1] != 0.) {
332
temp = *alpha * a[k + j * a_dim1];
334
for (i__ = 1; i__ <= i__2; ++i__) {
335
b[i__ + j * b_dim1] += temp * b[i__ + k *
346
for (j = 1; j <= i__1; ++j) {
349
temp *= a[j + j * a_dim1];
352
for (i__ = 1; i__ <= i__2; ++i__) {
353
b[i__ + j * b_dim1] = temp * b[i__ + j * b_dim1];
357
for (k = j + 1; k <= i__2; ++k) {
358
if (a[k + j * a_dim1] != 0.) {
359
temp = *alpha * a[k + j * a_dim1];
361
for (i__ = 1; i__ <= i__3; ++i__) {
362
b[i__ + j * b_dim1] += temp * b[i__ + k *
374
/* Form B := alpha*B*A**T. */
378
for (k = 1; k <= i__1; ++k) {
380
for (j = 1; j <= i__2; ++j) {
381
if (a[j + k * a_dim1] != 0.) {
382
temp = *alpha * a[j + k * a_dim1];
384
for (i__ = 1; i__ <= i__3; ++i__) {
385
b[i__ + j * b_dim1] += temp * b[i__ + k *
394
temp *= a[k + k * a_dim1];
398
for (i__ = 1; i__ <= i__2; ++i__) {
399
b[i__ + k * b_dim1] = temp * b[i__ + k * b_dim1];
406
for (k = *n; k >= 1; --k) {
408
for (j = k + 1; j <= i__1; ++j) {
409
if (a[j + k * a_dim1] != 0.) {
410
temp = *alpha * a[j + k * a_dim1];
412
for (i__ = 1; i__ <= i__2; ++i__) {
413
b[i__ + j * b_dim1] += temp * b[i__ + k *
422
temp *= a[k + k * a_dim1];
426
for (i__ = 1; i__ <= i__1; ++i__) {
427
b[i__ + k * b_dim1] = temp * b[i__ + k * b_dim1];