1
/* -- translated by f2c (version 20050501).
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
14
#include "arpack_internal.h"
17
/* Subroutine */ int igraphdtrmm_(char *side, char *uplo, char *transa, char *diag,
18
integer *m, integer *n, doublereal *alpha, doublereal *a, integer *
19
lda, doublereal *b, integer *ldb)
21
/* System generated locals */
22
integer a_dim1, a_offset, b_dim1, b_offset, i__1, i__2, i__3;
25
static integer i__, j, k, info;
26
static doublereal temp;
28
extern logical igraphlsame_(char *, char *);
31
extern /* Subroutine */ int igraphxerbla_(char *, integer *);
32
static logical nounit;
34
/* .. Scalar Arguments .. */
35
/* .. Array Arguments .. */
41
/* DTRMM performs one of the matrix-matrix operations */
43
/* B := alpha*op( A )*B, or B := alpha*B*op( A ), */
45
/* where alpha is a scalar, B is an m by n matrix, A is a unit, or */
46
/* non-unit, upper or lower triangular matrix and op( A ) is one of */
48
/* op( A ) = A or op( A ) = A'. */
53
/* SIDE - CHARACTER*1. */
54
/* On entry, SIDE specifies whether op( A ) multiplies B from */
55
/* the left or right as follows: */
57
/* SIDE = 'L' or 'l' B := alpha*op( A )*B. */
59
/* SIDE = 'R' or 'r' B := alpha*B*op( A ). */
61
/* Unchanged on exit. */
63
/* UPLO - CHARACTER*1. */
64
/* On entry, UPLO specifies whether the matrix A is an upper or */
65
/* lower triangular matrix as follows: */
67
/* UPLO = 'U' or 'u' A is an upper triangular matrix. */
69
/* UPLO = 'L' or 'l' A is a lower triangular matrix. */
71
/* Unchanged on exit. */
73
/* TRANSA - CHARACTER*1. */
74
/* On entry, TRANSA specifies the form of op( A ) to be used in */
75
/* the matrix multiplication as follows: */
77
/* TRANSA = 'N' or 'n' op( A ) = A. */
79
/* TRANSA = 'T' or 't' op( A ) = A'. */
81
/* TRANSA = 'C' or 'c' op( A ) = A'. */
83
/* Unchanged on exit. */
85
/* DIAG - CHARACTER*1. */
86
/* On entry, DIAG specifies whether or not A is unit triangular */
89
/* DIAG = 'U' or 'u' A is assumed to be unit triangular. */
91
/* DIAG = 'N' or 'n' A is not assumed to be unit */
94
/* Unchanged on exit. */
97
/* On entry, M specifies the number of rows of B. M must be at */
99
/* Unchanged on exit. */
102
/* On entry, N specifies the number of columns of B. N must be */
104
/* Unchanged on exit. */
106
/* ALPHA - DOUBLE PRECISION. */
107
/* On entry, ALPHA specifies the scalar alpha. When alpha is */
108
/* zero then A is not referenced and B need not be set before */
110
/* Unchanged on exit. */
112
/* A - DOUBLE PRECISION array of DIMENSION ( LDA, k ), where k is m */
113
/* when SIDE = 'L' or 'l' and is n when SIDE = 'R' or 'r'. */
114
/* Before entry with UPLO = 'U' or 'u', the leading k by k */
115
/* upper triangular part of the array A must contain the upper */
116
/* triangular matrix and the strictly lower triangular part of */
117
/* A is not referenced. */
118
/* Before entry with UPLO = 'L' or 'l', the leading k by k */
119
/* lower triangular part of the array A must contain the lower */
120
/* triangular matrix and the strictly upper triangular part of */
121
/* A is not referenced. */
122
/* Note that when DIAG = 'U' or 'u', the diagonal elements of */
123
/* A are not referenced either, but are assumed to be unity. */
124
/* Unchanged on exit. */
127
/* On entry, LDA specifies the first dimension of A as declared */
128
/* in the calling (sub) program. When SIDE = 'L' or 'l' then */
129
/* LDA must be at least max( 1, m ), when SIDE = 'R' or 'r' */
130
/* then LDA must be at least max( 1, n ). */
131
/* Unchanged on exit. */
133
/* B - DOUBLE PRECISION array of DIMENSION ( LDB, n ). */
134
/* Before entry, the leading m by n part of the array B must */
135
/* contain the matrix B, and on exit is overwritten by the */
136
/* transformed matrix. */
139
/* On entry, LDB specifies the first dimension of B as declared */
140
/* in the calling (sub) program. LDB must be at least */
142
/* Unchanged on exit. */
145
/* Level 3 Blas routine. */
147
/* -- Written on 8-February-1989. */
148
/* Jack Dongarra, Argonne National Laboratory. */
149
/* Iain Duff, AERE Harwell. */
150
/* Jeremy Du Croz, Numerical Algorithms Group Ltd. */
151
/* Sven Hammarling, Numerical Algorithms Group Ltd. */
154
/* .. External Functions .. */
155
/* .. External Subroutines .. */
156
/* .. Intrinsic Functions .. */
157
/* .. Local Scalars .. */
158
/* .. Parameters .. */
160
/* .. Executable Statements .. */
162
/* Test the input parameters. */
164
/* Parameter adjustments */
166
a_offset = 1 + a_dim1;
169
b_offset = 1 + b_dim1;
173
lside = igraphlsame_(side, "L");
179
nounit = igraphlsame_(diag, "N");
180
upper = igraphlsame_(uplo, "U");
183
if (! lside && ! igraphlsame_(side, "R")) {
185
} else if (! upper && ! igraphlsame_(uplo, "L")) {
187
} else if (! igraphlsame_(transa, "N") && ! igraphlsame_(transa,
188
"T") && ! igraphlsame_(transa, "C")) {
190
} else if (! igraphlsame_(diag, "U") && ! igraphlsame_(diag,
197
} else if (*lda < max(1,nrowa)) {
199
} else if (*ldb < max(1,*m)) {
203
igraphxerbla_("DTRMM ", &info);
207
/* Quick return if possible. */
213
/* And when alpha.eq.zero. */
217
for (j = 1; j <= i__1; ++j) {
219
for (i__ = 1; i__ <= i__2; ++i__) {
220
b[i__ + j * b_dim1] = 0.;
228
/* Start the operations. */
231
if (igraphlsame_(transa, "N")) {
233
/* Form B := alpha*A*B. */
237
for (j = 1; j <= i__1; ++j) {
239
for (k = 1; k <= i__2; ++k) {
240
if (b[k + j * b_dim1] != 0.) {
241
temp = *alpha * b[k + j * b_dim1];
243
for (i__ = 1; i__ <= i__3; ++i__) {
244
b[i__ + j * b_dim1] += temp * a[i__ + k *
249
temp *= a[k + k * a_dim1];
251
b[k + j * b_dim1] = temp;
259
for (j = 1; j <= i__1; ++j) {
260
for (k = *m; k >= 1; --k) {
261
if (b[k + j * b_dim1] != 0.) {
262
temp = *alpha * b[k + j * b_dim1];
263
b[k + j * b_dim1] = temp;
265
b[k + j * b_dim1] *= a[k + k * a_dim1];
268
for (i__ = k + 1; i__ <= i__2; ++i__) {
269
b[i__ + j * b_dim1] += temp * a[i__ + k *
281
/* Form B := alpha*A'*B. */
285
for (j = 1; j <= i__1; ++j) {
286
for (i__ = *m; i__ >= 1; --i__) {
287
temp = b[i__ + j * b_dim1];
289
temp *= a[i__ + i__ * a_dim1];
292
for (k = 1; k <= i__2; ++k) {
293
temp += a[k + i__ * a_dim1] * b[k + j * b_dim1];
296
b[i__ + j * b_dim1] = *alpha * temp;
303
for (j = 1; j <= i__1; ++j) {
305
for (i__ = 1; i__ <= i__2; ++i__) {
306
temp = b[i__ + j * b_dim1];
308
temp *= a[i__ + i__ * a_dim1];
311
for (k = i__ + 1; k <= i__3; ++k) {
312
temp += a[k + i__ * a_dim1] * b[k + j * b_dim1];
315
b[i__ + j * b_dim1] = *alpha * temp;
323
if (igraphlsame_(transa, "N")) {
325
/* Form B := alpha*B*A. */
328
for (j = *n; j >= 1; --j) {
331
temp *= a[j + j * a_dim1];
334
for (i__ = 1; i__ <= i__1; ++i__) {
335
b[i__ + j * b_dim1] = temp * b[i__ + j * b_dim1];
339
for (k = 1; k <= i__1; ++k) {
340
if (a[k + j * a_dim1] != 0.) {
341
temp = *alpha * a[k + j * a_dim1];
343
for (i__ = 1; i__ <= i__2; ++i__) {
344
b[i__ + j * b_dim1] += temp * b[i__ + k *
355
for (j = 1; j <= i__1; ++j) {
358
temp *= a[j + j * a_dim1];
361
for (i__ = 1; i__ <= i__2; ++i__) {
362
b[i__ + j * b_dim1] = temp * b[i__ + j * b_dim1];
366
for (k = j + 1; k <= i__2; ++k) {
367
if (a[k + j * a_dim1] != 0.) {
368
temp = *alpha * a[k + j * a_dim1];
370
for (i__ = 1; i__ <= i__3; ++i__) {
371
b[i__ + j * b_dim1] += temp * b[i__ + k *
383
/* Form B := alpha*B*A'. */
387
for (k = 1; k <= i__1; ++k) {
389
for (j = 1; j <= i__2; ++j) {
390
if (a[j + k * a_dim1] != 0.) {
391
temp = *alpha * a[j + k * a_dim1];
393
for (i__ = 1; i__ <= i__3; ++i__) {
394
b[i__ + j * b_dim1] += temp * b[i__ + k *
403
temp *= a[k + k * a_dim1];
407
for (i__ = 1; i__ <= i__2; ++i__) {
408
b[i__ + k * b_dim1] = temp * b[i__ + k * b_dim1];
415
for (k = *n; k >= 1; --k) {
417
for (j = k + 1; j <= i__1; ++j) {
418
if (a[j + k * a_dim1] != 0.) {
419
temp = *alpha * a[j + k * a_dim1];
421
for (i__ = 1; i__ <= i__2; ++i__) {
422
b[i__ + j * b_dim1] += temp * b[i__ + k *
431
temp *= a[k + k * a_dim1];
435
for (i__ = 1; i__ <= i__1; ++i__) {
436
b[i__ + k * b_dim1] = temp * b[i__ + k * b_dim1];