2
NOTE: This is generated code. Look in Misc/lapack_lite for information on
10
extern doublereal dlamch_(char *);
11
#define EPSILON dlamch_("Epsilon")
12
#define SAFEMINIMUM dlamch_("Safe minimum")
13
#define PRECISION dlamch_("Precision")
14
#define BASE dlamch_("Base")
17
extern doublereal dlapy2_(doublereal *x, doublereal *y);
21
/* Table of constant values */
23
static integer c__1 = 1;
24
static doublecomplex c_b359 = {1.,0.};
26
/* Subroutine */ int daxpy_(integer *n, doublereal *da, doublereal *dx,
27
integer *incx, doublereal *dy, integer *incy)
29
/* System generated locals */
33
static integer i__, m, ix, iy, mp1;
37
constant times a vector plus a vector.
38
uses unrolled loops for increments equal to one.
39
jack dongarra, linpack, 3/11/78.
40
modified 12/3/93, array(1) declarations changed to array(*)
44
/* Parameter adjustments */
55
if ((*incx == 1 && *incy == 1)) {
60
code for unequal increments or equal increments
67
ix = (-(*n) + 1) * *incx + 1;
70
iy = (-(*n) + 1) * *incy + 1;
73
for (i__ = 1; i__ <= i__1; ++i__) {
74
dy[iy] += *da * dx[ix];
82
code for both increments equal to 1
94
for (i__ = 1; i__ <= i__1; ++i__) {
95
dy[i__] += *da * dx[i__];
104
for (i__ = mp1; i__ <= i__1; i__ += 4) {
105
dy[i__] += *da * dx[i__];
106
dy[i__ + 1] += *da * dx[i__ + 1];
107
dy[i__ + 2] += *da * dx[i__ + 2];
108
dy[i__ + 3] += *da * dx[i__ + 3];
114
doublereal dcabs1_(doublecomplex *z__)
116
/* System generated locals */
118
static doublecomplex equiv_0[1];
120
/* Local variables */
121
#define t ((doublereal *)equiv_0)
124
zz->r = z__->r, zz->i = z__->i;
125
ret_val = abs(t[0]) + abs(t[1]);
133
/* Subroutine */ int dcopy_(integer *n, doublereal *dx, integer *incx,
134
doublereal *dy, integer *incy)
136
/* System generated locals */
139
/* Local variables */
140
static integer i__, m, ix, iy, mp1;
144
copies a vector, x, to a vector, y.
145
uses unrolled loops for increments equal to one.
146
jack dongarra, linpack, 3/11/78.
147
modified 12/3/93, array(1) declarations changed to array(*)
151
/* Parameter adjustments */
159
if ((*incx == 1 && *incy == 1)) {
164
code for unequal increments or equal increments
171
ix = (-(*n) + 1) * *incx + 1;
174
iy = (-(*n) + 1) * *incy + 1;
177
for (i__ = 1; i__ <= i__1; ++i__) {
186
code for both increments equal to 1
198
for (i__ = 1; i__ <= i__1; ++i__) {
208
for (i__ = mp1; i__ <= i__1; i__ += 7) {
210
dy[i__ + 1] = dx[i__ + 1];
211
dy[i__ + 2] = dx[i__ + 2];
212
dy[i__ + 3] = dx[i__ + 3];
213
dy[i__ + 4] = dx[i__ + 4];
214
dy[i__ + 5] = dx[i__ + 5];
215
dy[i__ + 6] = dx[i__ + 6];
221
doublereal ddot_(integer *n, doublereal *dx, integer *incx, doublereal *dy,
224
/* System generated locals */
228
/* Local variables */
229
static integer i__, m, ix, iy, mp1;
230
static doublereal dtemp;
234
forms the dot product of two vectors.
235
uses unrolled loops for increments equal to one.
236
jack dongarra, linpack, 3/11/78.
237
modified 12/3/93, array(1) declarations changed to array(*)
241
/* Parameter adjustments */
251
if ((*incx == 1 && *incy == 1)) {
256
code for unequal increments or equal increments
263
ix = (-(*n) + 1) * *incx + 1;
266
iy = (-(*n) + 1) * *incy + 1;
269
for (i__ = 1; i__ <= i__1; ++i__) {
270
dtemp += dx[ix] * dy[iy];
279
code for both increments equal to 1
291
for (i__ = 1; i__ <= i__1; ++i__) {
292
dtemp += dx[i__] * dy[i__];
301
for (i__ = mp1; i__ <= i__1; i__ += 5) {
302
dtemp = dtemp + dx[i__] * dy[i__] + dx[i__ + 1] * dy[i__ + 1] + dx[
303
i__ + 2] * dy[i__ + 2] + dx[i__ + 3] * dy[i__ + 3] + dx[i__ +
312
/* Subroutine */ int dgemm_(char *transa, char *transb, integer *m, integer *
313
n, integer *k, doublereal *alpha, doublereal *a, integer *lda,
314
doublereal *b, integer *ldb, doublereal *beta, doublereal *c__,
317
/* System generated locals */
318
integer a_dim1, a_offset, b_dim1, b_offset, c_dim1, c_offset, i__1, i__2,
321
/* Local variables */
322
static integer i__, j, l, info;
323
static logical nota, notb;
324
static doublereal temp;
325
static integer ncola;
326
extern logical lsame_(char *, char *);
327
static integer nrowa, nrowb;
328
extern /* Subroutine */ int xerbla_(char *, integer *);
335
DGEMM performs one of the matrix-matrix operations
337
C := alpha*op( A )*op( B ) + beta*C,
339
where op( X ) is one of
341
op( X ) = X or op( X ) = X',
343
alpha and beta are scalars, and A, B and C are matrices, with op( A )
344
an m by k matrix, op( B ) a k by n matrix and C an m by n matrix.
349
TRANSA - CHARACTER*1.
350
On entry, TRANSA specifies the form of op( A ) to be used in
351
the matrix multiplication as follows:
353
TRANSA = 'N' or 'n', op( A ) = A.
355
TRANSA = 'T' or 't', op( A ) = A'.
357
TRANSA = 'C' or 'c', op( A ) = A'.
361
TRANSB - CHARACTER*1.
362
On entry, TRANSB specifies the form of op( B ) to be used in
363
the matrix multiplication as follows:
365
TRANSB = 'N' or 'n', op( B ) = B.
367
TRANSB = 'T' or 't', op( B ) = B'.
369
TRANSB = 'C' or 'c', op( B ) = B'.
374
On entry, M specifies the number of rows of the matrix
375
op( A ) and of the matrix C. M must be at least zero.
379
On entry, N specifies the number of columns of the matrix
380
op( B ) and the number of columns of the matrix C. N must be
385
On entry, K specifies the number of columns of the matrix
386
op( A ) and the number of rows of the matrix op( B ). K must
390
ALPHA - DOUBLE PRECISION.
391
On entry, ALPHA specifies the scalar alpha.
394
A - DOUBLE PRECISION array of DIMENSION ( LDA, ka ), where ka is
395
k when TRANSA = 'N' or 'n', and is m otherwise.
396
Before entry with TRANSA = 'N' or 'n', the leading m by k
397
part of the array A must contain the matrix A, otherwise
398
the leading k by m part of the array A must contain the
403
On entry, LDA specifies the first dimension of A as declared
404
in the calling (sub) program. When TRANSA = 'N' or 'n' then
405
LDA must be at least max( 1, m ), otherwise LDA must be at
409
B - DOUBLE PRECISION array of DIMENSION ( LDB, kb ), where kb is
410
n when TRANSB = 'N' or 'n', and is k otherwise.
411
Before entry with TRANSB = 'N' or 'n', the leading k by n
412
part of the array B must contain the matrix B, otherwise
413
the leading n by k part of the array B must contain the
418
On entry, LDB specifies the first dimension of B as declared
419
in the calling (sub) program. When TRANSB = 'N' or 'n' then
420
LDB must be at least max( 1, k ), otherwise LDB must be at
424
BETA - DOUBLE PRECISION.
425
On entry, BETA specifies the scalar beta. When BETA is
426
supplied as zero then C need not be set on input.
429
C - DOUBLE PRECISION array of DIMENSION ( LDC, n ).
430
Before entry, the leading m by n part of the array C must
431
contain the matrix C, except when beta is zero, in which
432
case C need not be set on entry.
433
On exit, the array C is overwritten by the m by n matrix
434
( alpha*op( A )*op( B ) + beta*C ).
437
On entry, LDC specifies the first dimension of C as declared
438
in the calling (sub) program. LDC must be at least
443
Level 3 Blas routine.
445
-- Written on 8-February-1989.
446
Jack Dongarra, Argonne National Laboratory.
447
Iain Duff, AERE Harwell.
448
Jeremy Du Croz, Numerical Algorithms Group Ltd.
449
Sven Hammarling, Numerical Algorithms Group Ltd.
452
Set NOTA and NOTB as true if A and B respectively are not
453
transposed and set NROWA, NCOLA and NROWB as the number of rows
454
and columns of A and the number of rows of B respectively.
457
/* Parameter adjustments */
459
a_offset = 1 + a_dim1 * 1;
462
b_offset = 1 + b_dim1 * 1;
465
c_offset = 1 + c_dim1 * 1;
469
nota = lsame_(transa, "N");
470
notb = lsame_(transb, "N");
484
/* Test the input parameters. */
487
if (((! nota && ! lsame_(transa, "C")) && ! lsame_(
490
} else if (((! notb && ! lsame_(transb, "C")) && !
491
lsame_(transb, "T"))) {
499
} else if (*lda < max(1,nrowa)) {
501
} else if (*ldb < max(1,nrowb)) {
503
} else if (*ldc < max(1,*m)) {
507
xerbla_("DGEMM ", &info);
511
/* Quick return if possible. */
513
if (*m == 0 || *n == 0 || ((*alpha == 0. || *k == 0) && *beta == 1.)) {
517
/* And if alpha.eq.zero. */
522
for (j = 1; j <= i__1; ++j) {
524
for (i__ = 1; i__ <= i__2; ++i__) {
525
c__[i__ + j * c_dim1] = 0.;
532
for (j = 1; j <= i__1; ++j) {
534
for (i__ = 1; i__ <= i__2; ++i__) {
535
c__[i__ + j * c_dim1] = *beta * c__[i__ + j * c_dim1];
544
/* Start the operations. */
549
/* Form C := alpha*A*B + beta*C. */
552
for (j = 1; j <= i__1; ++j) {
555
for (i__ = 1; i__ <= i__2; ++i__) {
556
c__[i__ + j * c_dim1] = 0.;
559
} else if (*beta != 1.) {
561
for (i__ = 1; i__ <= i__2; ++i__) {
562
c__[i__ + j * c_dim1] = *beta * c__[i__ + j * c_dim1];
567
for (l = 1; l <= i__2; ++l) {
568
if (b[l + j * b_dim1] != 0.) {
569
temp = *alpha * b[l + j * b_dim1];
571
for (i__ = 1; i__ <= i__3; ++i__) {
572
c__[i__ + j * c_dim1] += temp * a[i__ + l *
583
/* Form C := alpha*A'*B + beta*C */
586
for (j = 1; j <= i__1; ++j) {
588
for (i__ = 1; i__ <= i__2; ++i__) {
591
for (l = 1; l <= i__3; ++l) {
592
temp += a[l + i__ * a_dim1] * b[l + j * b_dim1];
596
c__[i__ + j * c_dim1] = *alpha * temp;
598
c__[i__ + j * c_dim1] = *alpha * temp + *beta * c__[
609
/* Form C := alpha*A*B' + beta*C */
612
for (j = 1; j <= i__1; ++j) {
615
for (i__ = 1; i__ <= i__2; ++i__) {
616
c__[i__ + j * c_dim1] = 0.;
619
} else if (*beta != 1.) {
621
for (i__ = 1; i__ <= i__2; ++i__) {
622
c__[i__ + j * c_dim1] = *beta * c__[i__ + j * c_dim1];
627
for (l = 1; l <= i__2; ++l) {
628
if (b[j + l * b_dim1] != 0.) {
629
temp = *alpha * b[j + l * b_dim1];
631
for (i__ = 1; i__ <= i__3; ++i__) {
632
c__[i__ + j * c_dim1] += temp * a[i__ + l *
643
/* Form C := alpha*A'*B' + beta*C */
646
for (j = 1; j <= i__1; ++j) {
648
for (i__ = 1; i__ <= i__2; ++i__) {
651
for (l = 1; l <= i__3; ++l) {
652
temp += a[l + i__ * a_dim1] * b[j + l * b_dim1];
656
c__[i__ + j * c_dim1] = *alpha * temp;
658
c__[i__ + j * c_dim1] = *alpha * temp + *beta * c__[
674
/* Subroutine */ int dgemv_(char *trans, integer *m, integer *n, doublereal *
675
alpha, doublereal *a, integer *lda, doublereal *x, integer *incx,
676
doublereal *beta, doublereal *y, integer *incy)
678
/* System generated locals */
679
integer a_dim1, a_offset, i__1, i__2;
681
/* Local variables */
682
static integer i__, j, ix, iy, jx, jy, kx, ky, info;
683
static doublereal temp;
684
static integer lenx, leny;
685
extern logical lsame_(char *, char *);
686
extern /* Subroutine */ int xerbla_(char *, integer *);
693
DGEMV performs one of the matrix-vector operations
695
y := alpha*A*x + beta*y, or y := alpha*A'*x + beta*y,
697
where alpha and beta are scalars, x and y are vectors and A is an
704
On entry, TRANS specifies the operation to be performed as
707
TRANS = 'N' or 'n' y := alpha*A*x + beta*y.
709
TRANS = 'T' or 't' y := alpha*A'*x + beta*y.
711
TRANS = 'C' or 'c' y := alpha*A'*x + beta*y.
716
On entry, M specifies the number of rows of the matrix A.
717
M must be at least zero.
721
On entry, N specifies the number of columns of the matrix A.
722
N must be at least zero.
725
ALPHA - DOUBLE PRECISION.
726
On entry, ALPHA specifies the scalar alpha.
729
A - DOUBLE PRECISION array of DIMENSION ( LDA, n ).
730
Before entry, the leading m by n part of the array A must
731
contain the matrix of coefficients.
735
On entry, LDA specifies the first dimension of A as declared
736
in the calling (sub) program. LDA must be at least
740
X - DOUBLE PRECISION array of DIMENSION at least
741
( 1 + ( n - 1 )*abs( INCX ) ) when TRANS = 'N' or 'n'
743
( 1 + ( m - 1 )*abs( INCX ) ) otherwise.
744
Before entry, the incremented array X must contain the
749
On entry, INCX specifies the increment for the elements of
750
X. INCX must not be zero.
753
BETA - DOUBLE PRECISION.
754
On entry, BETA specifies the scalar beta. When BETA is
755
supplied as zero then Y need not be set on input.
758
Y - DOUBLE PRECISION array of DIMENSION at least
759
( 1 + ( m - 1 )*abs( INCY ) ) when TRANS = 'N' or 'n'
761
( 1 + ( n - 1 )*abs( INCY ) ) otherwise.
762
Before entry with BETA non-zero, the incremented array Y
763
must contain the vector y. On exit, Y is overwritten by the
767
On entry, INCY specifies the increment for the elements of
768
Y. INCY must not be zero.
772
Level 2 Blas routine.
774
-- Written on 22-October-1986.
775
Jack Dongarra, Argonne National Lab.
776
Jeremy Du Croz, Nag Central Office.
777
Sven Hammarling, Nag Central Office.
778
Richard Hanson, Sandia National Labs.
781
Test the input parameters.
784
/* Parameter adjustments */
786
a_offset = 1 + a_dim1 * 1;
793
if (((! lsame_(trans, "N") && ! lsame_(trans, "T")) && ! lsame_(trans, "C"))) {
799
} else if (*lda < max(1,*m)) {
801
} else if (*incx == 0) {
803
} else if (*incy == 0) {
807
xerbla_("DGEMV ", &info);
811
/* Quick return if possible. */
813
if (*m == 0 || *n == 0 || (*alpha == 0. && *beta == 1.)) {
818
Set LENX and LENY, the lengths of the vectors x and y, and set
819
up the start points in X and Y.
822
if (lsame_(trans, "N")) {
832
kx = 1 - (lenx - 1) * *incx;
837
ky = 1 - (leny - 1) * *incy;
841
Start the operations. In this version the elements of A are
842
accessed sequentially with one pass through A.
844
First form y := beta*y.
851
for (i__ = 1; i__ <= i__1; ++i__) {
857
for (i__ = 1; i__ <= i__1; ++i__) {
858
y[i__] = *beta * y[i__];
866
for (i__ = 1; i__ <= i__1; ++i__) {
873
for (i__ = 1; i__ <= i__1; ++i__) {
874
y[iy] = *beta * y[iy];
884
if (lsame_(trans, "N")) {
886
/* Form y := alpha*A*x + y. */
891
for (j = 1; j <= i__1; ++j) {
893
temp = *alpha * x[jx];
895
for (i__ = 1; i__ <= i__2; ++i__) {
896
y[i__] += temp * a[i__ + j * a_dim1];
905
for (j = 1; j <= i__1; ++j) {
907
temp = *alpha * x[jx];
910
for (i__ = 1; i__ <= i__2; ++i__) {
911
y[iy] += temp * a[i__ + j * a_dim1];
922
/* Form y := alpha*A'*x + y. */
927
for (j = 1; j <= i__1; ++j) {
930
for (i__ = 1; i__ <= i__2; ++i__) {
931
temp += a[i__ + j * a_dim1] * x[i__];
934
y[jy] += *alpha * temp;
940
for (j = 1; j <= i__1; ++j) {
944
for (i__ = 1; i__ <= i__2; ++i__) {
945
temp += a[i__ + j * a_dim1] * x[ix];
949
y[jy] += *alpha * temp;
962
/* Subroutine */ int dger_(integer *m, integer *n, doublereal *alpha,
963
doublereal *x, integer *incx, doublereal *y, integer *incy,
964
doublereal *a, integer *lda)
966
/* System generated locals */
967
integer a_dim1, a_offset, i__1, i__2;
969
/* Local variables */
970
static integer i__, j, ix, jy, kx, info;
971
static doublereal temp;
972
extern /* Subroutine */ int xerbla_(char *, integer *);
979
DGER performs the rank 1 operation
983
where alpha is a scalar, x is an m element vector, y is an n element
984
vector and A is an m by n matrix.
990
On entry, M specifies the number of rows of the matrix A.
991
M must be at least zero.
995
On entry, N specifies the number of columns of the matrix A.
996
N must be at least zero.
999
ALPHA - DOUBLE PRECISION.
1000
On entry, ALPHA specifies the scalar alpha.
1003
X - DOUBLE PRECISION array of dimension at least
1004
( 1 + ( m - 1 )*abs( INCX ) ).
1005
Before entry, the incremented array X must contain the m
1010
On entry, INCX specifies the increment for the elements of
1011
X. INCX must not be zero.
1014
Y - DOUBLE PRECISION array of dimension at least
1015
( 1 + ( n - 1 )*abs( INCY ) ).
1016
Before entry, the incremented array Y must contain the n
1021
On entry, INCY specifies the increment for the elements of
1022
Y. INCY must not be zero.
1025
A - DOUBLE PRECISION array of DIMENSION ( LDA, n ).
1026
Before entry, the leading m by n part of the array A must
1027
contain the matrix of coefficients. On exit, A is
1028
overwritten by the updated matrix.
1031
On entry, LDA specifies the first dimension of A as declared
1032
in the calling (sub) program. LDA must be at least
1037
Level 2 Blas routine.
1039
-- Written on 22-October-1986.
1040
Jack Dongarra, Argonne National Lab.
1041
Jeremy Du Croz, Nag Central Office.
1042
Sven Hammarling, Nag Central Office.
1043
Richard Hanson, Sandia National Labs.
1046
Test the input parameters.
1049
/* Parameter adjustments */
1053
a_offset = 1 + a_dim1 * 1;
1060
} else if (*n < 0) {
1062
} else if (*incx == 0) {
1064
} else if (*incy == 0) {
1066
} else if (*lda < max(1,*m)) {
1070
xerbla_("DGER ", &info);
1074
/* Quick return if possible. */
1076
if (*m == 0 || *n == 0 || *alpha == 0.) {
1081
Start the operations. In this version the elements of A are
1082
accessed sequentially with one pass through A.
1088
jy = 1 - (*n - 1) * *incy;
1092
for (j = 1; j <= i__1; ++j) {
1094
temp = *alpha * y[jy];
1096
for (i__ = 1; i__ <= i__2; ++i__) {
1097
a[i__ + j * a_dim1] += x[i__] * temp;
1108
kx = 1 - (*m - 1) * *incx;
1111
for (j = 1; j <= i__1; ++j) {
1113
temp = *alpha * y[jy];
1116
for (i__ = 1; i__ <= i__2; ++i__) {
1117
a[i__ + j * a_dim1] += x[ix] * temp;
1133
doublereal dnrm2_(integer *n, doublereal *x, integer *incx)
1135
/* System generated locals */
1137
doublereal ret_val, d__1;
1139
/* Builtin functions */
1140
double sqrt(doublereal);
1142
/* Local variables */
1144
static doublereal ssq, norm, scale, absxi;
1148
DNRM2 returns the euclidean norm of a vector via the function
1151
DNRM2 := sqrt( x'*x )
1154
-- This version written on 25-October-1982.
1155
Modified on 14-October-1993 to inline the call to DLASSQ.
1156
Sven Hammarling, Nag Ltd.
1160
/* Parameter adjustments */
1164
if (*n < 1 || *incx < 1) {
1166
} else if (*n == 1) {
1172
The following loop is equivalent to this call to the LAPACK
1174
CALL DLASSQ( N, X, INCX, SCALE, SSQ )
1177
i__1 = (*n - 1) * *incx + 1;
1179
for (ix = 1; i__2 < 0 ? ix >= i__1 : ix <= i__1; ix += i__2) {
1181
absxi = (d__1 = x[ix], abs(d__1));
1182
if (scale < absxi) {
1183
/* Computing 2nd power */
1184
d__1 = scale / absxi;
1185
ssq = ssq * (d__1 * d__1) + 1.;
1188
/* Computing 2nd power */
1189
d__1 = absxi / scale;
1195
norm = scale * sqrt(ssq);
1205
/* Subroutine */ int drot_(integer *n, doublereal *dx, integer *incx,
1206
doublereal *dy, integer *incy, doublereal *c__, doublereal *s)
1208
/* System generated locals */
1211
/* Local variables */
1212
static integer i__, ix, iy;
1213
static doublereal dtemp;
1217
applies a plane rotation.
1218
jack dongarra, linpack, 3/11/78.
1219
modified 12/3/93, array(1) declarations changed to array(*)
1223
/* Parameter adjustments */
1231
if ((*incx == 1 && *incy == 1)) {
1236
code for unequal increments or equal increments not equal
1243
ix = (-(*n) + 1) * *incx + 1;
1246
iy = (-(*n) + 1) * *incy + 1;
1249
for (i__ = 1; i__ <= i__1; ++i__) {
1250
dtemp = *c__ * dx[ix] + *s * dy[iy];
1251
dy[iy] = *c__ * dy[iy] - *s * dx[ix];
1259
/* code for both increments equal to 1 */
1263
for (i__ = 1; i__ <= i__1; ++i__) {
1264
dtemp = *c__ * dx[i__] + *s * dy[i__];
1265
dy[i__] = *c__ * dy[i__] - *s * dx[i__];
1272
/* Subroutine */ int dscal_(integer *n, doublereal *da, doublereal *dx,
1275
/* System generated locals */
1278
/* Local variables */
1279
static integer i__, m, mp1, nincx;
1283
scales a vector by a constant.
1284
uses unrolled loops for increment equal to one.
1285
jack dongarra, linpack, 3/11/78.
1286
modified 3/93 to return if incx .le. 0.
1287
modified 12/3/93, array(1) declarations changed to array(*)
1291
/* Parameter adjustments */
1295
if (*n <= 0 || *incx <= 0) {
1302
/* code for increment not equal to 1 */
1307
for (i__ = 1; i__2 < 0 ? i__ >= i__1 : i__ <= i__1; i__ += i__2) {
1308
dx[i__] = *da * dx[i__];
1314
code for increment equal to 1
1326
for (i__ = 1; i__ <= i__2; ++i__) {
1327
dx[i__] = *da * dx[i__];
1336
for (i__ = mp1; i__ <= i__2; i__ += 5) {
1337
dx[i__] = *da * dx[i__];
1338
dx[i__ + 1] = *da * dx[i__ + 1];
1339
dx[i__ + 2] = *da * dx[i__ + 2];
1340
dx[i__ + 3] = *da * dx[i__ + 3];
1341
dx[i__ + 4] = *da * dx[i__ + 4];
1347
/* Subroutine */ int dswap_(integer *n, doublereal *dx, integer *incx,
1348
doublereal *dy, integer *incy)
1350
/* System generated locals */
1353
/* Local variables */
1354
static integer i__, m, ix, iy, mp1;
1355
static doublereal dtemp;
1359
interchanges two vectors.
1360
uses unrolled loops for increments equal one.
1361
jack dongarra, linpack, 3/11/78.
1362
modified 12/3/93, array(1) declarations changed to array(*)
1366
/* Parameter adjustments */
1374
if ((*incx == 1 && *incy == 1)) {
1379
code for unequal increments or equal increments not equal
1386
ix = (-(*n) + 1) * *incx + 1;
1389
iy = (-(*n) + 1) * *incy + 1;
1392
for (i__ = 1; i__ <= i__1; ++i__) {
1403
code for both increments equal to 1
1415
for (i__ = 1; i__ <= i__1; ++i__) {
1427
for (i__ = mp1; i__ <= i__1; i__ += 3) {
1431
dtemp = dx[i__ + 1];
1432
dx[i__ + 1] = dy[i__ + 1];
1433
dy[i__ + 1] = dtemp;
1434
dtemp = dx[i__ + 2];
1435
dx[i__ + 2] = dy[i__ + 2];
1436
dy[i__ + 2] = dtemp;
1442
/* Subroutine */ int dsymv_(char *uplo, integer *n, doublereal *alpha,
1443
doublereal *a, integer *lda, doublereal *x, integer *incx, doublereal
1444
*beta, doublereal *y, integer *incy)
1446
/* System generated locals */
1447
integer a_dim1, a_offset, i__1, i__2;
1449
/* Local variables */
1450
static integer i__, j, ix, iy, jx, jy, kx, ky, info;
1451
static doublereal temp1, temp2;
1452
extern logical lsame_(char *, char *);
1453
extern /* Subroutine */ int xerbla_(char *, integer *);
1460
DSYMV performs the matrix-vector operation
1462
y := alpha*A*x + beta*y,
1464
where alpha and beta are scalars, x and y are n element vectors and
1465
A is an n by n symmetric matrix.
1471
On entry, UPLO specifies whether the upper or lower
1472
triangular part of the array A is to be referenced as
1475
UPLO = 'U' or 'u' Only the upper triangular part of A
1476
is to be referenced.
1478
UPLO = 'L' or 'l' Only the lower triangular part of A
1479
is to be referenced.
1484
On entry, N specifies the order of the matrix A.
1485
N must be at least zero.
1488
ALPHA - DOUBLE PRECISION.
1489
On entry, ALPHA specifies the scalar alpha.
1492
A - DOUBLE PRECISION array of DIMENSION ( LDA, n ).
1493
Before entry with UPLO = 'U' or 'u', the leading n by n
1494
upper triangular part of the array A must contain the upper
1495
triangular part of the symmetric matrix and the strictly
1496
lower triangular part of A is not referenced.
1497
Before entry with UPLO = 'L' or 'l', the leading n by n
1498
lower triangular part of the array A must contain the lower
1499
triangular part of the symmetric matrix and the strictly
1500
upper triangular part of A is not referenced.
1504
On entry, LDA specifies the first dimension of A as declared
1505
in the calling (sub) program. LDA must be at least
1509
X - DOUBLE PRECISION array of dimension at least
1510
( 1 + ( n - 1 )*abs( INCX ) ).
1511
Before entry, the incremented array X must contain the n
1516
On entry, INCX specifies the increment for the elements of
1517
X. INCX must not be zero.
1520
BETA - DOUBLE PRECISION.
1521
On entry, BETA specifies the scalar beta. When BETA is
1522
supplied as zero then Y need not be set on input.
1525
Y - DOUBLE PRECISION array of dimension at least
1526
( 1 + ( n - 1 )*abs( INCY ) ).
1527
Before entry, the incremented array Y must contain the n
1528
element vector y. On exit, Y is overwritten by the updated
1532
On entry, INCY specifies the increment for the elements of
1533
Y. INCY must not be zero.
1537
Level 2 Blas routine.
1539
-- Written on 22-October-1986.
1540
Jack Dongarra, Argonne National Lab.
1541
Jeremy Du Croz, Nag Central Office.
1542
Sven Hammarling, Nag Central Office.
1543
Richard Hanson, Sandia National Labs.
1546
Test the input parameters.
1549
/* Parameter adjustments */
1551
a_offset = 1 + a_dim1 * 1;
1558
if ((! lsame_(uplo, "U") && ! lsame_(uplo, "L"))) {
1560
} else if (*n < 0) {
1562
} else if (*lda < max(1,*n)) {
1564
} else if (*incx == 0) {
1566
} else if (*incy == 0) {
1570
xerbla_("DSYMV ", &info);
1574
/* Quick return if possible. */
1576
if (*n == 0 || (*alpha == 0. && *beta == 1.)) {
1580
/* Set up the start points in X and Y. */
1585
kx = 1 - (*n - 1) * *incx;
1590
ky = 1 - (*n - 1) * *incy;
1594
Start the operations. In this version the elements of A are
1595
accessed sequentially with one pass through the triangular part
1598
First form y := beta*y.
1605
for (i__ = 1; i__ <= i__1; ++i__) {
1611
for (i__ = 1; i__ <= i__1; ++i__) {
1612
y[i__] = *beta * y[i__];
1620
for (i__ = 1; i__ <= i__1; ++i__) {
1627
for (i__ = 1; i__ <= i__1; ++i__) {
1628
y[iy] = *beta * y[iy];
1638
if (lsame_(uplo, "U")) {
1640
/* Form y when A is stored in upper triangle. */
1642
if ((*incx == 1 && *incy == 1)) {
1644
for (j = 1; j <= i__1; ++j) {
1645
temp1 = *alpha * x[j];
1648
for (i__ = 1; i__ <= i__2; ++i__) {
1649
y[i__] += temp1 * a[i__ + j * a_dim1];
1650
temp2 += a[i__ + j * a_dim1] * x[i__];
1653
y[j] = y[j] + temp1 * a[j + j * a_dim1] + *alpha * temp2;
1660
for (j = 1; j <= i__1; ++j) {
1661
temp1 = *alpha * x[jx];
1666
for (i__ = 1; i__ <= i__2; ++i__) {
1667
y[iy] += temp1 * a[i__ + j * a_dim1];
1668
temp2 += a[i__ + j * a_dim1] * x[ix];
1673
y[jy] = y[jy] + temp1 * a[j + j * a_dim1] + *alpha * temp2;
1681
/* Form y when A is stored in lower triangle. */
1683
if ((*incx == 1 && *incy == 1)) {
1685
for (j = 1; j <= i__1; ++j) {
1686
temp1 = *alpha * x[j];
1688
y[j] += temp1 * a[j + j * a_dim1];
1690
for (i__ = j + 1; i__ <= i__2; ++i__) {
1691
y[i__] += temp1 * a[i__ + j * a_dim1];
1692
temp2 += a[i__ + j * a_dim1] * x[i__];
1695
y[j] += *alpha * temp2;
1702
for (j = 1; j <= i__1; ++j) {
1703
temp1 = *alpha * x[jx];
1705
y[jy] += temp1 * a[j + j * a_dim1];
1709
for (i__ = j + 1; i__ <= i__2; ++i__) {
1712
y[iy] += temp1 * a[i__ + j * a_dim1];
1713
temp2 += a[i__ + j * a_dim1] * x[ix];
1716
y[jy] += *alpha * temp2;
1726
/* End of DSYMV . */
1730
/* Subroutine */ int dsyr2_(char *uplo, integer *n, doublereal *alpha,
1731
doublereal *x, integer *incx, doublereal *y, integer *incy,
1732
doublereal *a, integer *lda)
1734
/* System generated locals */
1735
integer a_dim1, a_offset, i__1, i__2;
1737
/* Local variables */
1738
static integer i__, j, ix, iy, jx, jy, kx, ky, info;
1739
static doublereal temp1, temp2;
1740
extern logical lsame_(char *, char *);
1741
extern /* Subroutine */ int xerbla_(char *, integer *);
1748
DSYR2 performs the symmetric rank 2 operation
1750
A := alpha*x*y' + alpha*y*x' + A,
1752
where alpha is a scalar, x and y are n element vectors and A is an n
1753
by n symmetric matrix.
1759
On entry, UPLO specifies whether the upper or lower
1760
triangular part of the array A is to be referenced as
1763
UPLO = 'U' or 'u' Only the upper triangular part of A
1764
is to be referenced.
1766
UPLO = 'L' or 'l' Only the lower triangular part of A
1767
is to be referenced.
1772
On entry, N specifies the order of the matrix A.
1773
N must be at least zero.
1776
ALPHA - DOUBLE PRECISION.
1777
On entry, ALPHA specifies the scalar alpha.
1780
X - DOUBLE PRECISION array of dimension at least
1781
( 1 + ( n - 1 )*abs( INCX ) ).
1782
Before entry, the incremented array X must contain the n
1787
On entry, INCX specifies the increment for the elements of
1788
X. INCX must not be zero.
1791
Y - DOUBLE PRECISION array of dimension at least
1792
( 1 + ( n - 1 )*abs( INCY ) ).
1793
Before entry, the incremented array Y must contain the n
1798
On entry, INCY specifies the increment for the elements of
1799
Y. INCY must not be zero.
1802
A - DOUBLE PRECISION array of DIMENSION ( LDA, n ).
1803
Before entry with UPLO = 'U' or 'u', the leading n by n
1804
upper triangular part of the array A must contain the upper
1805
triangular part of the symmetric matrix and the strictly
1806
lower triangular part of A is not referenced. On exit, the
1807
upper triangular part of the array A is overwritten by the
1808
upper triangular part of the updated matrix.
1809
Before entry with UPLO = 'L' or 'l', the leading n by n
1810
lower triangular part of the array A must contain the lower
1811
triangular part of the symmetric matrix and the strictly
1812
upper triangular part of A is not referenced. On exit, the
1813
lower triangular part of the array A is overwritten by the
1814
lower triangular part of the updated matrix.
1817
On entry, LDA specifies the first dimension of A as declared
1818
in the calling (sub) program. LDA must be at least
1823
Level 2 Blas routine.
1825
-- Written on 22-October-1986.
1826
Jack Dongarra, Argonne National Lab.
1827
Jeremy Du Croz, Nag Central Office.
1828
Sven Hammarling, Nag Central Office.
1829
Richard Hanson, Sandia National Labs.
1832
Test the input parameters.
1835
/* Parameter adjustments */
1839
a_offset = 1 + a_dim1 * 1;
1844
if ((! lsame_(uplo, "U") && ! lsame_(uplo, "L"))) {
1846
} else if (*n < 0) {
1848
} else if (*incx == 0) {
1850
} else if (*incy == 0) {
1852
} else if (*lda < max(1,*n)) {
1856
xerbla_("DSYR2 ", &info);
1860
/* Quick return if possible. */
1862
if (*n == 0 || *alpha == 0.) {
1867
Set up the start points in X and Y if the increments are not both
1871
if (*incx != 1 || *incy != 1) {
1875
kx = 1 - (*n - 1) * *incx;
1880
ky = 1 - (*n - 1) * *incy;
1887
Start the operations. In this version the elements of A are
1888
accessed sequentially with one pass through the triangular part
1892
if (lsame_(uplo, "U")) {
1894
/* Form A when A is stored in the upper triangle. */
1896
if ((*incx == 1 && *incy == 1)) {
1898
for (j = 1; j <= i__1; ++j) {
1899
if (x[j] != 0. || y[j] != 0.) {
1900
temp1 = *alpha * y[j];
1901
temp2 = *alpha * x[j];
1903
for (i__ = 1; i__ <= i__2; ++i__) {
1904
a[i__ + j * a_dim1] = a[i__ + j * a_dim1] + x[i__] *
1905
temp1 + y[i__] * temp2;
1913
for (j = 1; j <= i__1; ++j) {
1914
if (x[jx] != 0. || y[jy] != 0.) {
1915
temp1 = *alpha * y[jy];
1916
temp2 = *alpha * x[jx];
1920
for (i__ = 1; i__ <= i__2; ++i__) {
1921
a[i__ + j * a_dim1] = a[i__ + j * a_dim1] + x[ix] *
1922
temp1 + y[iy] * temp2;
1935
/* Form A when A is stored in the lower triangle. */
1937
if ((*incx == 1 && *incy == 1)) {
1939
for (j = 1; j <= i__1; ++j) {
1940
if (x[j] != 0. || y[j] != 0.) {
1941
temp1 = *alpha * y[j];
1942
temp2 = *alpha * x[j];
1944
for (i__ = j; i__ <= i__2; ++i__) {
1945
a[i__ + j * a_dim1] = a[i__ + j * a_dim1] + x[i__] *
1946
temp1 + y[i__] * temp2;
1954
for (j = 1; j <= i__1; ++j) {
1955
if (x[jx] != 0. || y[jy] != 0.) {
1956
temp1 = *alpha * y[jy];
1957
temp2 = *alpha * x[jx];
1961
for (i__ = j; i__ <= i__2; ++i__) {
1962
a[i__ + j * a_dim1] = a[i__ + j * a_dim1] + x[ix] *
1963
temp1 + y[iy] * temp2;
1978
/* End of DSYR2 . */
1982
/* Subroutine */ int dsyr2k_(char *uplo, char *trans, integer *n, integer *k,
1983
doublereal *alpha, doublereal *a, integer *lda, doublereal *b,
1984
integer *ldb, doublereal *beta, doublereal *c__, integer *ldc)
1986
/* System generated locals */
1987
integer a_dim1, a_offset, b_dim1, b_offset, c_dim1, c_offset, i__1, i__2,
1990
/* Local variables */
1991
static integer i__, j, l, info;
1992
static doublereal temp1, temp2;
1993
extern logical lsame_(char *, char *);
1994
static integer nrowa;
1995
static logical upper;
1996
extern /* Subroutine */ int xerbla_(char *, integer *);
2003
DSYR2K performs one of the symmetric rank 2k operations
2005
C := alpha*A*B' + alpha*B*A' + beta*C,
2009
C := alpha*A'*B + alpha*B'*A + beta*C,
2011
where alpha and beta are scalars, C is an n by n symmetric matrix
2012
and A and B are n by k matrices in the first case and k by n
2013
matrices in the second case.
2019
On entry, UPLO specifies whether the upper or lower
2020
triangular part of the array C is to be referenced as
2023
UPLO = 'U' or 'u' Only the upper triangular part of C
2024
is to be referenced.
2026
UPLO = 'L' or 'l' Only the lower triangular part of C
2027
is to be referenced.
2031
TRANS - CHARACTER*1.
2032
On entry, TRANS specifies the operation to be performed as
2035
TRANS = 'N' or 'n' C := alpha*A*B' + alpha*B*A' +
2038
TRANS = 'T' or 't' C := alpha*A'*B + alpha*B'*A +
2041
TRANS = 'C' or 'c' C := alpha*A'*B + alpha*B'*A +
2047
On entry, N specifies the order of the matrix C. N must be
2052
On entry with TRANS = 'N' or 'n', K specifies the number
2053
of columns of the matrices A and B, and on entry with
2054
TRANS = 'T' or 't' or 'C' or 'c', K specifies the number
2055
of rows of the matrices A and B. K must be at least zero.
2058
ALPHA - DOUBLE PRECISION.
2059
On entry, ALPHA specifies the scalar alpha.
2062
A - DOUBLE PRECISION array of DIMENSION ( LDA, ka ), where ka is
2063
k when TRANS = 'N' or 'n', and is n otherwise.
2064
Before entry with TRANS = 'N' or 'n', the leading n by k
2065
part of the array A must contain the matrix A, otherwise
2066
the leading k by n part of the array A must contain the
2071
On entry, LDA specifies the first dimension of A as declared
2072
in the calling (sub) program. When TRANS = 'N' or 'n'
2073
then LDA must be at least max( 1, n ), otherwise LDA must
2074
be at least max( 1, k ).
2077
B - DOUBLE PRECISION array of DIMENSION ( LDB, kb ), where kb is
2078
k when TRANS = 'N' or 'n', and is n otherwise.
2079
Before entry with TRANS = 'N' or 'n', the leading n by k
2080
part of the array B must contain the matrix B, otherwise
2081
the leading k by n part of the array B must contain the
2086
On entry, LDB specifies the first dimension of B as declared
2087
in the calling (sub) program. When TRANS = 'N' or 'n'
2088
then LDB must be at least max( 1, n ), otherwise LDB must
2089
be at least max( 1, k ).
2092
BETA - DOUBLE PRECISION.
2093
On entry, BETA specifies the scalar beta.
2096
C - DOUBLE PRECISION array of DIMENSION ( LDC, n ).
2097
Before entry with UPLO = 'U' or 'u', the leading n by n
2098
upper triangular part of the array C must contain the upper
2099
triangular part of the symmetric matrix and the strictly
2100
lower triangular part of C is not referenced. On exit, the
2101
upper triangular part of the array C is overwritten by the
2102
upper triangular part of the updated matrix.
2103
Before entry with UPLO = 'L' or 'l', the leading n by n
2104
lower triangular part of the array C must contain the lower
2105
triangular part of the symmetric matrix and the strictly
2106
upper triangular part of C is not referenced. On exit, the
2107
lower triangular part of the array C is overwritten by the
2108
lower triangular part of the updated matrix.
2111
On entry, LDC specifies the first dimension of C as declared
2112
in the calling (sub) program. LDC must be at least
2117
Level 3 Blas routine.
2120
-- Written on 8-February-1989.
2121
Jack Dongarra, Argonne National Laboratory.
2122
Iain Duff, AERE Harwell.
2123
Jeremy Du Croz, Numerical Algorithms Group Ltd.
2124
Sven Hammarling, Numerical Algorithms Group Ltd.
2127
Test the input parameters.
2130
/* Parameter adjustments */
2132
a_offset = 1 + a_dim1 * 1;
2135
b_offset = 1 + b_dim1 * 1;
2138
c_offset = 1 + c_dim1 * 1;
2142
if (lsame_(trans, "N")) {
2147
upper = lsame_(uplo, "U");
2150
if ((! upper && ! lsame_(uplo, "L"))) {
2152
} else if (((! lsame_(trans, "N") && ! lsame_(trans,
2153
"T")) && ! lsame_(trans, "C"))) {
2155
} else if (*n < 0) {
2157
} else if (*k < 0) {
2159
} else if (*lda < max(1,nrowa)) {
2161
} else if (*ldb < max(1,nrowa)) {
2163
} else if (*ldc < max(1,*n)) {
2167
xerbla_("DSYR2K", &info);
2171
/* Quick return if possible. */
2173
if (*n == 0 || ((*alpha == 0. || *k == 0) && *beta == 1.)) {
2177
/* And when alpha.eq.zero. */
2183
for (j = 1; j <= i__1; ++j) {
2185
for (i__ = 1; i__ <= i__2; ++i__) {
2186
c__[i__ + j * c_dim1] = 0.;
2193
for (j = 1; j <= i__1; ++j) {
2195
for (i__ = 1; i__ <= i__2; ++i__) {
2196
c__[i__ + j * c_dim1] = *beta * c__[i__ + j * c_dim1];
2205
for (j = 1; j <= i__1; ++j) {
2207
for (i__ = j; i__ <= i__2; ++i__) {
2208
c__[i__ + j * c_dim1] = 0.;
2215
for (j = 1; j <= i__1; ++j) {
2217
for (i__ = j; i__ <= i__2; ++i__) {
2218
c__[i__ + j * c_dim1] = *beta * c__[i__ + j * c_dim1];
2228
/* Start the operations. */
2230
if (lsame_(trans, "N")) {
2232
/* Form C := alpha*A*B' + alpha*B*A' + C. */
2236
for (j = 1; j <= i__1; ++j) {
2239
for (i__ = 1; i__ <= i__2; ++i__) {
2240
c__[i__ + j * c_dim1] = 0.;
2243
} else if (*beta != 1.) {
2245
for (i__ = 1; i__ <= i__2; ++i__) {
2246
c__[i__ + j * c_dim1] = *beta * c__[i__ + j * c_dim1];
2251
for (l = 1; l <= i__2; ++l) {
2252
if (a[j + l * a_dim1] != 0. || b[j + l * b_dim1] != 0.) {
2253
temp1 = *alpha * b[j + l * b_dim1];
2254
temp2 = *alpha * a[j + l * a_dim1];
2256
for (i__ = 1; i__ <= i__3; ++i__) {
2257
c__[i__ + j * c_dim1] = c__[i__ + j * c_dim1] + a[
2258
i__ + l * a_dim1] * temp1 + b[i__ + l *
2269
for (j = 1; j <= i__1; ++j) {
2272
for (i__ = j; i__ <= i__2; ++i__) {
2273
c__[i__ + j * c_dim1] = 0.;
2276
} else if (*beta != 1.) {
2278
for (i__ = j; i__ <= i__2; ++i__) {
2279
c__[i__ + j * c_dim1] = *beta * c__[i__ + j * c_dim1];
2284
for (l = 1; l <= i__2; ++l) {
2285
if (a[j + l * a_dim1] != 0. || b[j + l * b_dim1] != 0.) {
2286
temp1 = *alpha * b[j + l * b_dim1];
2287
temp2 = *alpha * a[j + l * a_dim1];
2289
for (i__ = j; i__ <= i__3; ++i__) {
2290
c__[i__ + j * c_dim1] = c__[i__ + j * c_dim1] + a[
2291
i__ + l * a_dim1] * temp1 + b[i__ + l *
2303
/* Form C := alpha*A'*B + alpha*B'*A + C. */
2307
for (j = 1; j <= i__1; ++j) {
2309
for (i__ = 1; i__ <= i__2; ++i__) {
2313
for (l = 1; l <= i__3; ++l) {
2314
temp1 += a[l + i__ * a_dim1] * b[l + j * b_dim1];
2315
temp2 += b[l + i__ * b_dim1] * a[l + j * a_dim1];
2319
c__[i__ + j * c_dim1] = *alpha * temp1 + *alpha *
2322
c__[i__ + j * c_dim1] = *beta * c__[i__ + j * c_dim1]
2323
+ *alpha * temp1 + *alpha * temp2;
2331
for (j = 1; j <= i__1; ++j) {
2333
for (i__ = j; i__ <= i__2; ++i__) {
2337
for (l = 1; l <= i__3; ++l) {
2338
temp1 += a[l + i__ * a_dim1] * b[l + j * b_dim1];
2339
temp2 += b[l + i__ * b_dim1] * a[l + j * a_dim1];
2343
c__[i__ + j * c_dim1] = *alpha * temp1 + *alpha *
2346
c__[i__ + j * c_dim1] = *beta * c__[i__ + j * c_dim1]
2347
+ *alpha * temp1 + *alpha * temp2;
2358
/* End of DSYR2K. */
2362
/* Subroutine */ int dsyrk_(char *uplo, char *trans, integer *n, integer *k,
2363
doublereal *alpha, doublereal *a, integer *lda, doublereal *beta,
2364
doublereal *c__, integer *ldc)
2366
/* System generated locals */
2367
integer a_dim1, a_offset, c_dim1, c_offset, i__1, i__2, i__3;
2369
/* Local variables */
2370
static integer i__, j, l, info;
2371
static doublereal temp;
2372
extern logical lsame_(char *, char *);
2373
static integer nrowa;
2374
static logical upper;
2375
extern /* Subroutine */ int xerbla_(char *, integer *);
2382
DSYRK performs one of the symmetric rank k operations
2384
C := alpha*A*A' + beta*C,
2388
C := alpha*A'*A + beta*C,
2390
where alpha and beta are scalars, C is an n by n symmetric matrix
2391
and A is an n by k matrix in the first case and a k by n matrix
2398
On entry, UPLO specifies whether the upper or lower
2399
triangular part of the array C is to be referenced as
2402
UPLO = 'U' or 'u' Only the upper triangular part of C
2403
is to be referenced.
2405
UPLO = 'L' or 'l' Only the lower triangular part of C
2406
is to be referenced.
2410
TRANS - CHARACTER*1.
2411
On entry, TRANS specifies the operation to be performed as
2414
TRANS = 'N' or 'n' C := alpha*A*A' + beta*C.
2416
TRANS = 'T' or 't' C := alpha*A'*A + beta*C.
2418
TRANS = 'C' or 'c' C := alpha*A'*A + beta*C.
2423
On entry, N specifies the order of the matrix C. N must be
2428
On entry with TRANS = 'N' or 'n', K specifies the number
2429
of columns of the matrix A, and on entry with
2430
TRANS = 'T' or 't' or 'C' or 'c', K specifies the number
2431
of rows of the matrix A. K must be at least zero.
2434
ALPHA - DOUBLE PRECISION.
2435
On entry, ALPHA specifies the scalar alpha.
2438
A - DOUBLE PRECISION array of DIMENSION ( LDA, ka ), where ka is
2439
k when TRANS = 'N' or 'n', and is n otherwise.
2440
Before entry with TRANS = 'N' or 'n', the leading n by k
2441
part of the array A must contain the matrix A, otherwise
2442
the leading k by n part of the array A must contain the
2447
On entry, LDA specifies the first dimension of A as declared
2448
in the calling (sub) program. When TRANS = 'N' or 'n'
2449
then LDA must be at least max( 1, n ), otherwise LDA must
2450
be at least max( 1, k ).
2453
BETA - DOUBLE PRECISION.
2454
On entry, BETA specifies the scalar beta.
2457
C - DOUBLE PRECISION array of DIMENSION ( LDC, n ).
2458
Before entry with UPLO = 'U' or 'u', the leading n by n
2459
upper triangular part of the array C must contain the upper
2460
triangular part of the symmetric matrix and the strictly
2461
lower triangular part of C is not referenced. On exit, the
2462
upper triangular part of the array C is overwritten by the
2463
upper triangular part of the updated matrix.
2464
Before entry with UPLO = 'L' or 'l', the leading n by n
2465
lower triangular part of the array C must contain the lower
2466
triangular part of the symmetric matrix and the strictly
2467
upper triangular part of C is not referenced. On exit, the
2468
lower triangular part of the array C is overwritten by the
2469
lower triangular part of the updated matrix.
2472
On entry, LDC specifies the first dimension of C as declared
2473
in the calling (sub) program. LDC must be at least
2478
Level 3 Blas routine.
2480
-- Written on 8-February-1989.
2481
Jack Dongarra, Argonne National Laboratory.
2482
Iain Duff, AERE Harwell.
2483
Jeremy Du Croz, Numerical Algorithms Group Ltd.
2484
Sven Hammarling, Numerical Algorithms Group Ltd.
2487
Test the input parameters.
2490
/* Parameter adjustments */
2492
a_offset = 1 + a_dim1 * 1;
2495
c_offset = 1 + c_dim1 * 1;
2499
if (lsame_(trans, "N")) {
2504
upper = lsame_(uplo, "U");
2507
if ((! upper && ! lsame_(uplo, "L"))) {
2509
} else if (((! lsame_(trans, "N") && ! lsame_(trans,
2510
"T")) && ! lsame_(trans, "C"))) {
2512
} else if (*n < 0) {
2514
} else if (*k < 0) {
2516
} else if (*lda < max(1,nrowa)) {
2518
} else if (*ldc < max(1,*n)) {
2522
xerbla_("DSYRK ", &info);
2526
/* Quick return if possible. */
2528
if (*n == 0 || ((*alpha == 0. || *k == 0) && *beta == 1.)) {
2532
/* And when alpha.eq.zero. */
2538
for (j = 1; j <= i__1; ++j) {
2540
for (i__ = 1; i__ <= i__2; ++i__) {
2541
c__[i__ + j * c_dim1] = 0.;
2548
for (j = 1; j <= i__1; ++j) {
2550
for (i__ = 1; i__ <= i__2; ++i__) {
2551
c__[i__ + j * c_dim1] = *beta * c__[i__ + j * c_dim1];
2560
for (j = 1; j <= i__1; ++j) {
2562
for (i__ = j; i__ <= i__2; ++i__) {
2563
c__[i__ + j * c_dim1] = 0.;
2570
for (j = 1; j <= i__1; ++j) {
2572
for (i__ = j; i__ <= i__2; ++i__) {
2573
c__[i__ + j * c_dim1] = *beta * c__[i__ + j * c_dim1];
2583
/* Start the operations. */
2585
if (lsame_(trans, "N")) {
2587
/* Form C := alpha*A*A' + beta*C. */
2591
for (j = 1; j <= i__1; ++j) {
2594
for (i__ = 1; i__ <= i__2; ++i__) {
2595
c__[i__ + j * c_dim1] = 0.;
2598
} else if (*beta != 1.) {
2600
for (i__ = 1; i__ <= i__2; ++i__) {
2601
c__[i__ + j * c_dim1] = *beta * c__[i__ + j * c_dim1];
2606
for (l = 1; l <= i__2; ++l) {
2607
if (a[j + l * a_dim1] != 0.) {
2608
temp = *alpha * a[j + l * a_dim1];
2610
for (i__ = 1; i__ <= i__3; ++i__) {
2611
c__[i__ + j * c_dim1] += temp * a[i__ + l *
2622
for (j = 1; j <= i__1; ++j) {
2625
for (i__ = j; i__ <= i__2; ++i__) {
2626
c__[i__ + j * c_dim1] = 0.;
2629
} else if (*beta != 1.) {
2631
for (i__ = j; i__ <= i__2; ++i__) {
2632
c__[i__ + j * c_dim1] = *beta * c__[i__ + j * c_dim1];
2637
for (l = 1; l <= i__2; ++l) {
2638
if (a[j + l * a_dim1] != 0.) {
2639
temp = *alpha * a[j + l * a_dim1];
2641
for (i__ = j; i__ <= i__3; ++i__) {
2642
c__[i__ + j * c_dim1] += temp * a[i__ + l *
2654
/* Form C := alpha*A'*A + beta*C. */
2658
for (j = 1; j <= i__1; ++j) {
2660
for (i__ = 1; i__ <= i__2; ++i__) {
2663
for (l = 1; l <= i__3; ++l) {
2664
temp += a[l + i__ * a_dim1] * a[l + j * a_dim1];
2668
c__[i__ + j * c_dim1] = *alpha * temp;
2670
c__[i__ + j * c_dim1] = *alpha * temp + *beta * c__[
2679
for (j = 1; j <= i__1; ++j) {
2681
for (i__ = j; i__ <= i__2; ++i__) {
2684
for (l = 1; l <= i__3; ++l) {
2685
temp += a[l + i__ * a_dim1] * a[l + j * a_dim1];
2689
c__[i__ + j * c_dim1] = *alpha * temp;
2691
c__[i__ + j * c_dim1] = *alpha * temp + *beta * c__[
2703
/* End of DSYRK . */
2707
/* Subroutine */ int dtrmm_(char *side, char *uplo, char *transa, char *diag,
2708
integer *m, integer *n, doublereal *alpha, doublereal *a, integer *
2709
lda, doublereal *b, integer *ldb)
2711
/* System generated locals */
2712
integer a_dim1, a_offset, b_dim1, b_offset, i__1, i__2, i__3;
2714
/* Local variables */
2715
static integer i__, j, k, info;
2716
static doublereal temp;
2717
static logical lside;
2718
extern logical lsame_(char *, char *);
2719
static integer nrowa;
2720
static logical upper;
2721
extern /* Subroutine */ int xerbla_(char *, integer *);
2722
static logical nounit;
2729
DTRMM performs one of the matrix-matrix operations
2731
B := alpha*op( A )*B, or B := alpha*B*op( A ),
2733
where alpha is a scalar, B is an m by n matrix, A is a unit, or
2734
non-unit, upper or lower triangular matrix and op( A ) is one of
2736
op( A ) = A or op( A ) = A'.
2742
On entry, SIDE specifies whether op( A ) multiplies B from
2743
the left or right as follows:
2745
SIDE = 'L' or 'l' B := alpha*op( A )*B.
2747
SIDE = 'R' or 'r' B := alpha*B*op( A ).
2752
On entry, UPLO specifies whether the matrix A is an upper or
2753
lower triangular matrix as follows:
2755
UPLO = 'U' or 'u' A is an upper triangular matrix.
2757
UPLO = 'L' or 'l' A is a lower triangular matrix.
2761
TRANSA - CHARACTER*1.
2762
On entry, TRANSA specifies the form of op( A ) to be used in
2763
the matrix multiplication as follows:
2765
TRANSA = 'N' or 'n' op( A ) = A.
2767
TRANSA = 'T' or 't' op( A ) = A'.
2769
TRANSA = 'C' or 'c' op( A ) = A'.
2774
On entry, DIAG specifies whether or not A is unit triangular
2777
DIAG = 'U' or 'u' A is assumed to be unit triangular.
2779
DIAG = 'N' or 'n' A is not assumed to be unit
2785
On entry, M specifies the number of rows of B. M must be at
2790
On entry, N specifies the number of columns of B. N must be
2794
ALPHA - DOUBLE PRECISION.
2795
On entry, ALPHA specifies the scalar alpha. When alpha is
2796
zero then A is not referenced and B need not be set before
2800
A - DOUBLE PRECISION array of DIMENSION ( LDA, k ), where k is m
2801
when SIDE = 'L' or 'l' and is n when SIDE = 'R' or 'r'.
2802
Before entry with UPLO = 'U' or 'u', the leading k by k
2803
upper triangular part of the array A must contain the upper
2804
triangular matrix and the strictly lower triangular part of
2805
A is not referenced.
2806
Before entry with UPLO = 'L' or 'l', the leading k by k
2807
lower triangular part of the array A must contain the lower
2808
triangular matrix and the strictly upper triangular part of
2809
A is not referenced.
2810
Note that when DIAG = 'U' or 'u', the diagonal elements of
2811
A are not referenced either, but are assumed to be unity.
2815
On entry, LDA specifies the first dimension of A as declared
2816
in the calling (sub) program. When SIDE = 'L' or 'l' then
2817
LDA must be at least max( 1, m ), when SIDE = 'R' or 'r'
2818
then LDA must be at least max( 1, n ).
2821
B - DOUBLE PRECISION array of DIMENSION ( LDB, n ).
2822
Before entry, the leading m by n part of the array B must
2823
contain the matrix B, and on exit is overwritten by the
2827
On entry, LDB specifies the first dimension of B as declared
2828
in the calling (sub) program. LDB must be at least
2833
Level 3 Blas routine.
2835
-- Written on 8-February-1989.
2836
Jack Dongarra, Argonne National Laboratory.
2837
Iain Duff, AERE Harwell.
2838
Jeremy Du Croz, Numerical Algorithms Group Ltd.
2839
Sven Hammarling, Numerical Algorithms Group Ltd.
2842
Test the input parameters.
2845
/* Parameter adjustments */
2847
a_offset = 1 + a_dim1 * 1;
2850
b_offset = 1 + b_dim1 * 1;
2854
lside = lsame_(side, "L");
2860
nounit = lsame_(diag, "N");
2861
upper = lsame_(uplo, "U");
2864
if ((! lside && ! lsame_(side, "R"))) {
2866
} else if ((! upper && ! lsame_(uplo, "L"))) {
2868
} else if (((! lsame_(transa, "N") && ! lsame_(
2869
transa, "T")) && ! lsame_(transa, "C"))) {
2871
} else if ((! lsame_(diag, "U") && ! lsame_(diag,
2874
} else if (*m < 0) {
2876
} else if (*n < 0) {
2878
} else if (*lda < max(1,nrowa)) {
2880
} else if (*ldb < max(1,*m)) {
2884
xerbla_("DTRMM ", &info);
2888
/* Quick return if possible. */
2894
/* And when alpha.eq.zero. */
2898
for (j = 1; j <= i__1; ++j) {
2900
for (i__ = 1; i__ <= i__2; ++i__) {
2901
b[i__ + j * b_dim1] = 0.;
2909
/* Start the operations. */
2912
if (lsame_(transa, "N")) {
2914
/* Form B := alpha*A*B. */
2918
for (j = 1; j <= i__1; ++j) {
2920
for (k = 1; k <= i__2; ++k) {
2921
if (b[k + j * b_dim1] != 0.) {
2922
temp = *alpha * b[k + j * b_dim1];
2924
for (i__ = 1; i__ <= i__3; ++i__) {
2925
b[i__ + j * b_dim1] += temp * a[i__ + k *
2930
temp *= a[k + k * a_dim1];
2932
b[k + j * b_dim1] = temp;
2940
for (j = 1; j <= i__1; ++j) {
2941
for (k = *m; k >= 1; --k) {
2942
if (b[k + j * b_dim1] != 0.) {
2943
temp = *alpha * b[k + j * b_dim1];
2944
b[k + j * b_dim1] = temp;
2946
b[k + j * b_dim1] *= a[k + k * a_dim1];
2949
for (i__ = k + 1; i__ <= i__2; ++i__) {
2950
b[i__ + j * b_dim1] += temp * a[i__ + k *
2962
/* Form B := alpha*A'*B. */
2966
for (j = 1; j <= i__1; ++j) {
2967
for (i__ = *m; i__ >= 1; --i__) {
2968
temp = b[i__ + j * b_dim1];
2970
temp *= a[i__ + i__ * a_dim1];
2973
for (k = 1; k <= i__2; ++k) {
2974
temp += a[k + i__ * a_dim1] * b[k + j * b_dim1];
2977
b[i__ + j * b_dim1] = *alpha * temp;
2984
for (j = 1; j <= i__1; ++j) {
2986
for (i__ = 1; i__ <= i__2; ++i__) {
2987
temp = b[i__ + j * b_dim1];
2989
temp *= a[i__ + i__ * a_dim1];
2992
for (k = i__ + 1; k <= i__3; ++k) {
2993
temp += a[k + i__ * a_dim1] * b[k + j * b_dim1];
2996
b[i__ + j * b_dim1] = *alpha * temp;
3004
if (lsame_(transa, "N")) {
3006
/* Form B := alpha*B*A. */
3009
for (j = *n; j >= 1; --j) {
3012
temp *= a[j + j * a_dim1];
3015
for (i__ = 1; i__ <= i__1; ++i__) {
3016
b[i__ + j * b_dim1] = temp * b[i__ + j * b_dim1];
3020
for (k = 1; k <= i__1; ++k) {
3021
if (a[k + j * a_dim1] != 0.) {
3022
temp = *alpha * a[k + j * a_dim1];
3024
for (i__ = 1; i__ <= i__2; ++i__) {
3025
b[i__ + j * b_dim1] += temp * b[i__ + k *
3036
for (j = 1; j <= i__1; ++j) {
3039
temp *= a[j + j * a_dim1];
3042
for (i__ = 1; i__ <= i__2; ++i__) {
3043
b[i__ + j * b_dim1] = temp * b[i__ + j * b_dim1];
3047
for (k = j + 1; k <= i__2; ++k) {
3048
if (a[k + j * a_dim1] != 0.) {
3049
temp = *alpha * a[k + j * a_dim1];
3051
for (i__ = 1; i__ <= i__3; ++i__) {
3052
b[i__ + j * b_dim1] += temp * b[i__ + k *
3064
/* Form B := alpha*B*A'. */
3068
for (k = 1; k <= i__1; ++k) {
3070
for (j = 1; j <= i__2; ++j) {
3071
if (a[j + k * a_dim1] != 0.) {
3072
temp = *alpha * a[j + k * a_dim1];
3074
for (i__ = 1; i__ <= i__3; ++i__) {
3075
b[i__ + j * b_dim1] += temp * b[i__ + k *
3084
temp *= a[k + k * a_dim1];
3088
for (i__ = 1; i__ <= i__2; ++i__) {
3089
b[i__ + k * b_dim1] = temp * b[i__ + k * b_dim1];
3096
for (k = *n; k >= 1; --k) {
3098
for (j = k + 1; j <= i__1; ++j) {
3099
if (a[j + k * a_dim1] != 0.) {
3100
temp = *alpha * a[j + k * a_dim1];
3102
for (i__ = 1; i__ <= i__2; ++i__) {
3103
b[i__ + j * b_dim1] += temp * b[i__ + k *
3112
temp *= a[k + k * a_dim1];
3116
for (i__ = 1; i__ <= i__1; ++i__) {
3117
b[i__ + k * b_dim1] = temp * b[i__ + k * b_dim1];
3129
/* End of DTRMM . */
3133
/* Subroutine */ int dtrmv_(char *uplo, char *trans, char *diag, integer *n,
3134
doublereal *a, integer *lda, doublereal *x, integer *incx)
3136
/* System generated locals */
3137
integer a_dim1, a_offset, i__1, i__2;
3139
/* Local variables */
3140
static integer i__, j, ix, jx, kx, info;
3141
static doublereal temp;
3142
extern logical lsame_(char *, char *);
3143
extern /* Subroutine */ int xerbla_(char *, integer *);
3144
static logical nounit;
3151
DTRMV performs one of the matrix-vector operations
3153
x := A*x, or x := A'*x,
3155
where x is an n element vector and A is an n by n unit, or non-unit,
3156
upper or lower triangular matrix.
3162
On entry, UPLO specifies whether the matrix is an upper or
3163
lower triangular matrix as follows:
3165
UPLO = 'U' or 'u' A is an upper triangular matrix.
3167
UPLO = 'L' or 'l' A is a lower triangular matrix.
3171
TRANS - CHARACTER*1.
3172
On entry, TRANS specifies the operation to be performed as
3175
TRANS = 'N' or 'n' x := A*x.
3177
TRANS = 'T' or 't' x := A'*x.
3179
TRANS = 'C' or 'c' x := A'*x.
3184
On entry, DIAG specifies whether or not A is unit
3185
triangular as follows:
3187
DIAG = 'U' or 'u' A is assumed to be unit triangular.
3189
DIAG = 'N' or 'n' A is not assumed to be unit
3195
On entry, N specifies the order of the matrix A.
3196
N must be at least zero.
3199
A - DOUBLE PRECISION array of DIMENSION ( LDA, n ).
3200
Before entry with UPLO = 'U' or 'u', the leading n by n
3201
upper triangular part of the array A must contain the upper
3202
triangular matrix and the strictly lower triangular part of
3203
A is not referenced.
3204
Before entry with UPLO = 'L' or 'l', the leading n by n
3205
lower triangular part of the array A must contain the lower
3206
triangular matrix and the strictly upper triangular part of
3207
A is not referenced.
3208
Note that when DIAG = 'U' or 'u', the diagonal elements of
3209
A are not referenced either, but are assumed to be unity.
3213
On entry, LDA specifies the first dimension of A as declared
3214
in the calling (sub) program. LDA must be at least
3218
X - DOUBLE PRECISION array of dimension at least
3219
( 1 + ( n - 1 )*abs( INCX ) ).
3220
Before entry, the incremented array X must contain the n
3221
element vector x. On exit, X is overwritten with the
3222
tranformed vector x.
3225
On entry, INCX specifies the increment for the elements of
3226
X. INCX must not be zero.
3230
Level 2 Blas routine.
3232
-- Written on 22-October-1986.
3233
Jack Dongarra, Argonne National Lab.
3234
Jeremy Du Croz, Nag Central Office.
3235
Sven Hammarling, Nag Central Office.
3236
Richard Hanson, Sandia National Labs.
3239
Test the input parameters.
3242
/* Parameter adjustments */
3244
a_offset = 1 + a_dim1 * 1;
3250
if ((! lsame_(uplo, "U") && ! lsame_(uplo, "L"))) {
3252
} else if (((! lsame_(trans, "N") && ! lsame_(trans,
3253
"T")) && ! lsame_(trans, "C"))) {
3255
} else if ((! lsame_(diag, "U") && ! lsame_(diag,
3258
} else if (*n < 0) {
3260
} else if (*lda < max(1,*n)) {
3262
} else if (*incx == 0) {
3266
xerbla_("DTRMV ", &info);
3270
/* Quick return if possible. */
3276
nounit = lsame_(diag, "N");
3279
Set up the start point in X if the increment is not unity. This
3280
will be ( N - 1 )*INCX too small for descending loops.
3284
kx = 1 - (*n - 1) * *incx;
3285
} else if (*incx != 1) {
3290
Start the operations. In this version the elements of A are
3291
accessed sequentially with one pass through A.
3294
if (lsame_(trans, "N")) {
3296
/* Form x := A*x. */
3298
if (lsame_(uplo, "U")) {
3301
for (j = 1; j <= i__1; ++j) {
3305
for (i__ = 1; i__ <= i__2; ++i__) {
3306
x[i__] += temp * a[i__ + j * a_dim1];
3310
x[j] *= a[j + j * a_dim1];
3318
for (j = 1; j <= i__1; ++j) {
3323
for (i__ = 1; i__ <= i__2; ++i__) {
3324
x[ix] += temp * a[i__ + j * a_dim1];
3329
x[jx] *= a[j + j * a_dim1];
3338
for (j = *n; j >= 1; --j) {
3342
for (i__ = *n; i__ >= i__1; --i__) {
3343
x[i__] += temp * a[i__ + j * a_dim1];
3347
x[j] *= a[j + j * a_dim1];
3353
kx += (*n - 1) * *incx;
3355
for (j = *n; j >= 1; --j) {
3360
for (i__ = *n; i__ >= i__1; --i__) {
3361
x[ix] += temp * a[i__ + j * a_dim1];
3366
x[jx] *= a[j + j * a_dim1];
3376
/* Form x := A'*x. */
3378
if (lsame_(uplo, "U")) {
3380
for (j = *n; j >= 1; --j) {
3383
temp *= a[j + j * a_dim1];
3385
for (i__ = j - 1; i__ >= 1; --i__) {
3386
temp += a[i__ + j * a_dim1] * x[i__];
3393
jx = kx + (*n - 1) * *incx;
3394
for (j = *n; j >= 1; --j) {
3398
temp *= a[j + j * a_dim1];
3400
for (i__ = j - 1; i__ >= 1; --i__) {
3402
temp += a[i__ + j * a_dim1] * x[ix];
3413
for (j = 1; j <= i__1; ++j) {
3416
temp *= a[j + j * a_dim1];
3419
for (i__ = j + 1; i__ <= i__2; ++i__) {
3420
temp += a[i__ + j * a_dim1] * x[i__];
3429
for (j = 1; j <= i__1; ++j) {
3433
temp *= a[j + j * a_dim1];
3436
for (i__ = j + 1; i__ <= i__2; ++i__) {
3438
temp += a[i__ + j * a_dim1] * x[ix];
3451
/* End of DTRMV . */
3455
/* Subroutine */ int dtrsm_(char *side, char *uplo, char *transa, char *diag,
3456
integer *m, integer *n, doublereal *alpha, doublereal *a, integer *
3457
lda, doublereal *b, integer *ldb)
3459
/* System generated locals */
3460
integer a_dim1, a_offset, b_dim1, b_offset, i__1, i__2, i__3;
3462
/* Local variables */
3463
static integer i__, j, k, info;
3464
static doublereal temp;
3465
static logical lside;
3466
extern logical lsame_(char *, char *);
3467
static integer nrowa;
3468
static logical upper;
3469
extern /* Subroutine */ int xerbla_(char *, integer *);
3470
static logical nounit;
3477
DTRSM solves one of the matrix equations
3479
op( A )*X = alpha*B, or X*op( A ) = alpha*B,
3481
where alpha is a scalar, X and B are m by n matrices, A is a unit, or
3482
non-unit, upper or lower triangular matrix and op( A ) is one of
3484
op( A ) = A or op( A ) = A'.
3486
The matrix X is overwritten on B.
3492
On entry, SIDE specifies whether op( A ) appears on the left
3493
or right of X as follows:
3495
SIDE = 'L' or 'l' op( A )*X = alpha*B.
3497
SIDE = 'R' or 'r' X*op( A ) = alpha*B.
3502
On entry, UPLO specifies whether the matrix A is an upper or
3503
lower triangular matrix as follows:
3505
UPLO = 'U' or 'u' A is an upper triangular matrix.
3507
UPLO = 'L' or 'l' A is a lower triangular matrix.
3511
TRANSA - CHARACTER*1.
3512
On entry, TRANSA specifies the form of op( A ) to be used in
3513
the matrix multiplication as follows:
3515
TRANSA = 'N' or 'n' op( A ) = A.
3517
TRANSA = 'T' or 't' op( A ) = A'.
3519
TRANSA = 'C' or 'c' op( A ) = A'.
3524
On entry, DIAG specifies whether or not A is unit triangular
3527
DIAG = 'U' or 'u' A is assumed to be unit triangular.
3529
DIAG = 'N' or 'n' A is not assumed to be unit
3535
On entry, M specifies the number of rows of B. M must be at
3540
On entry, N specifies the number of columns of B. N must be
3544
ALPHA - DOUBLE PRECISION.
3545
On entry, ALPHA specifies the scalar alpha. When alpha is
3546
zero then A is not referenced and B need not be set before
3550
A - DOUBLE PRECISION array of DIMENSION ( LDA, k ), where k is m
3551
when SIDE = 'L' or 'l' and is n when SIDE = 'R' or 'r'.
3552
Before entry with UPLO = 'U' or 'u', the leading k by k
3553
upper triangular part of the array A must contain the upper
3554
triangular matrix and the strictly lower triangular part of
3555
A is not referenced.
3556
Before entry with UPLO = 'L' or 'l', the leading k by k
3557
lower triangular part of the array A must contain the lower
3558
triangular matrix and the strictly upper triangular part of
3559
A is not referenced.
3560
Note that when DIAG = 'U' or 'u', the diagonal elements of
3561
A are not referenced either, but are assumed to be unity.
3565
On entry, LDA specifies the first dimension of A as declared
3566
in the calling (sub) program. When SIDE = 'L' or 'l' then
3567
LDA must be at least max( 1, m ), when SIDE = 'R' or 'r'
3568
then LDA must be at least max( 1, n ).
3571
B - DOUBLE PRECISION array of DIMENSION ( LDB, n ).
3572
Before entry, the leading m by n part of the array B must
3573
contain the right-hand side matrix B, and on exit is
3574
overwritten by the solution matrix X.
3577
On entry, LDB specifies the first dimension of B as declared
3578
in the calling (sub) program. LDB must be at least
3583
Level 3 Blas routine.
3586
-- Written on 8-February-1989.
3587
Jack Dongarra, Argonne National Laboratory.
3588
Iain Duff, AERE Harwell.
3589
Jeremy Du Croz, Numerical Algorithms Group Ltd.
3590
Sven Hammarling, Numerical Algorithms Group Ltd.
3593
Test the input parameters.
3596
/* Parameter adjustments */
3598
a_offset = 1 + a_dim1 * 1;
3601
b_offset = 1 + b_dim1 * 1;
3605
lside = lsame_(side, "L");
3611
nounit = lsame_(diag, "N");
3612
upper = lsame_(uplo, "U");
3615
if ((! lside && ! lsame_(side, "R"))) {
3617
} else if ((! upper && ! lsame_(uplo, "L"))) {
3619
} else if (((! lsame_(transa, "N") && ! lsame_(
3620
transa, "T")) && ! lsame_(transa, "C"))) {
3622
} else if ((! lsame_(diag, "U") && ! lsame_(diag,
3625
} else if (*m < 0) {
3627
} else if (*n < 0) {
3629
} else if (*lda < max(1,nrowa)) {
3631
} else if (*ldb < max(1,*m)) {
3635
xerbla_("DTRSM ", &info);
3639
/* Quick return if possible. */
3645
/* And when alpha.eq.zero. */
3649
for (j = 1; j <= i__1; ++j) {
3651
for (i__ = 1; i__ <= i__2; ++i__) {
3652
b[i__ + j * b_dim1] = 0.;
3660
/* Start the operations. */
3663
if (lsame_(transa, "N")) {
3665
/* Form B := alpha*inv( A )*B. */
3669
for (j = 1; j <= i__1; ++j) {
3672
for (i__ = 1; i__ <= i__2; ++i__) {
3673
b[i__ + j * b_dim1] = *alpha * b[i__ + j * b_dim1]
3678
for (k = *m; k >= 1; --k) {
3679
if (b[k + j * b_dim1] != 0.) {
3681
b[k + j * b_dim1] /= a[k + k * a_dim1];
3684
for (i__ = 1; i__ <= i__2; ++i__) {
3685
b[i__ + j * b_dim1] -= b[k + j * b_dim1] * a[
3696
for (j = 1; j <= i__1; ++j) {
3699
for (i__ = 1; i__ <= i__2; ++i__) {
3700
b[i__ + j * b_dim1] = *alpha * b[i__ + j * b_dim1]
3706
for (k = 1; k <= i__2; ++k) {
3707
if (b[k + j * b_dim1] != 0.) {
3709
b[k + j * b_dim1] /= a[k + k * a_dim1];
3712
for (i__ = k + 1; i__ <= i__3; ++i__) {
3713
b[i__ + j * b_dim1] -= b[k + j * b_dim1] * a[
3725
/* Form B := alpha*inv( A' )*B. */
3729
for (j = 1; j <= i__1; ++j) {
3731
for (i__ = 1; i__ <= i__2; ++i__) {
3732
temp = *alpha * b[i__ + j * b_dim1];
3734
for (k = 1; k <= i__3; ++k) {
3735
temp -= a[k + i__ * a_dim1] * b[k + j * b_dim1];
3739
temp /= a[i__ + i__ * a_dim1];
3741
b[i__ + j * b_dim1] = temp;
3748
for (j = 1; j <= i__1; ++j) {
3749
for (i__ = *m; i__ >= 1; --i__) {
3750
temp = *alpha * b[i__ + j * b_dim1];
3752
for (k = i__ + 1; k <= i__2; ++k) {
3753
temp -= a[k + i__ * a_dim1] * b[k + j * b_dim1];
3757
temp /= a[i__ + i__ * a_dim1];
3759
b[i__ + j * b_dim1] = temp;
3767
if (lsame_(transa, "N")) {
3769
/* Form B := alpha*B*inv( A ). */
3773
for (j = 1; j <= i__1; ++j) {
3776
for (i__ = 1; i__ <= i__2; ++i__) {
3777
b[i__ + j * b_dim1] = *alpha * b[i__ + j * b_dim1]
3783
for (k = 1; k <= i__2; ++k) {
3784
if (a[k + j * a_dim1] != 0.) {
3786
for (i__ = 1; i__ <= i__3; ++i__) {
3787
b[i__ + j * b_dim1] -= a[k + j * a_dim1] * b[
3795
temp = 1. / a[j + j * a_dim1];
3797
for (i__ = 1; i__ <= i__2; ++i__) {
3798
b[i__ + j * b_dim1] = temp * b[i__ + j * b_dim1];
3805
for (j = *n; j >= 1; --j) {
3808
for (i__ = 1; i__ <= i__1; ++i__) {
3809
b[i__ + j * b_dim1] = *alpha * b[i__ + j * b_dim1]
3815
for (k = j + 1; k <= i__1; ++k) {
3816
if (a[k + j * a_dim1] != 0.) {
3818
for (i__ = 1; i__ <= i__2; ++i__) {
3819
b[i__ + j * b_dim1] -= a[k + j * a_dim1] * b[
3827
temp = 1. / a[j + j * a_dim1];
3829
for (i__ = 1; i__ <= i__1; ++i__) {
3830
b[i__ + j * b_dim1] = temp * b[i__ + j * b_dim1];
3839
/* Form B := alpha*B*inv( A' ). */
3842
for (k = *n; k >= 1; --k) {
3844
temp = 1. / a[k + k * a_dim1];
3846
for (i__ = 1; i__ <= i__1; ++i__) {
3847
b[i__ + k * b_dim1] = temp * b[i__ + k * b_dim1];
3852
for (j = 1; j <= i__1; ++j) {
3853
if (a[j + k * a_dim1] != 0.) {
3854
temp = a[j + k * a_dim1];
3856
for (i__ = 1; i__ <= i__2; ++i__) {
3857
b[i__ + j * b_dim1] -= temp * b[i__ + k *
3866
for (i__ = 1; i__ <= i__1; ++i__) {
3867
b[i__ + k * b_dim1] = *alpha * b[i__ + k * b_dim1]
3876
for (k = 1; k <= i__1; ++k) {
3878
temp = 1. / a[k + k * a_dim1];
3880
for (i__ = 1; i__ <= i__2; ++i__) {
3881
b[i__ + k * b_dim1] = temp * b[i__ + k * b_dim1];
3886
for (j = k + 1; j <= i__2; ++j) {
3887
if (a[j + k * a_dim1] != 0.) {
3888
temp = a[j + k * a_dim1];
3890
for (i__ = 1; i__ <= i__3; ++i__) {
3891
b[i__ + j * b_dim1] -= temp * b[i__ + k *
3900
for (i__ = 1; i__ <= i__2; ++i__) {
3901
b[i__ + k * b_dim1] = *alpha * b[i__ + k * b_dim1]
3914
/* End of DTRSM . */
3918
doublereal dzasum_(integer *n, doublecomplex *zx, integer *incx)
3920
/* System generated locals */
3924
/* Local variables */
3925
static integer i__, ix;
3926
static doublereal stemp;
3927
extern doublereal dcabs1_(doublecomplex *);
3931
takes the sum of the absolute values.
3932
jack dongarra, 3/11/78.
3933
modified 3/93 to return if incx .le. 0.
3934
modified 12/3/93, array(1) declarations changed to array(*)
3938
/* Parameter adjustments */
3944
if (*n <= 0 || *incx <= 0) {
3951
/* code for increment not equal to 1 */
3955
for (i__ = 1; i__ <= i__1; ++i__) {
3956
stemp += dcabs1_(&zx[ix]);
3963
/* code for increment equal to 1 */
3967
for (i__ = 1; i__ <= i__1; ++i__) {
3968
stemp += dcabs1_(&zx[i__]);
3975
doublereal dznrm2_(integer *n, doublecomplex *x, integer *incx)
3977
/* System generated locals */
3978
integer i__1, i__2, i__3;
3979
doublereal ret_val, d__1;
3981
/* Builtin functions */
3982
double d_imag(doublecomplex *), sqrt(doublereal);
3984
/* Local variables */
3986
static doublereal ssq, temp, norm, scale;
3990
DZNRM2 returns the euclidean norm of a vector via the function
3993
DZNRM2 := sqrt( conjg( x' )*x )
3996
-- This version written on 25-October-1982.
3997
Modified on 14-October-1993 to inline the call to ZLASSQ.
3998
Sven Hammarling, Nag Ltd.
4002
/* Parameter adjustments */
4006
if (*n < 1 || *incx < 1) {
4012
The following loop is equivalent to this call to the LAPACK
4014
CALL ZLASSQ( N, X, INCX, SCALE, SSQ )
4017
i__1 = (*n - 1) * *incx + 1;
4019
for (ix = 1; i__2 < 0 ? ix >= i__1 : ix <= i__1; ix += i__2) {
4021
if (x[i__3].r != 0.) {
4023
temp = (d__1 = x[i__3].r, abs(d__1));
4025
/* Computing 2nd power */
4026
d__1 = scale / temp;
4027
ssq = ssq * (d__1 * d__1) + 1.;
4030
/* Computing 2nd power */
4031
d__1 = temp / scale;
4035
if (d_imag(&x[ix]) != 0.) {
4036
temp = (d__1 = d_imag(&x[ix]), abs(d__1));
4038
/* Computing 2nd power */
4039
d__1 = scale / temp;
4040
ssq = ssq * (d__1 * d__1) + 1.;
4043
/* Computing 2nd power */
4044
d__1 = temp / scale;
4050
norm = scale * sqrt(ssq);
4056
/* End of DZNRM2. */
4060
integer idamax_(integer *n, doublereal *dx, integer *incx)
4062
/* System generated locals */
4063
integer ret_val, i__1;
4066
/* Local variables */
4067
static integer i__, ix;
4068
static doublereal dmax__;
4072
finds the index of element having max. absolute value.
4073
jack dongarra, linpack, 3/11/78.
4074
modified 3/93 to return if incx .le. 0.
4075
modified 12/3/93, array(1) declarations changed to array(*)
4079
/* Parameter adjustments */
4084
if (*n < 1 || *incx <= 0) {
4095
/* code for increment not equal to 1 */
4098
dmax__ = abs(dx[1]);
4101
for (i__ = 2; i__ <= i__1; ++i__) {
4102
if ((d__1 = dx[ix], abs(d__1)) <= dmax__) {
4106
dmax__ = (d__1 = dx[ix], abs(d__1));
4113
/* code for increment equal to 1 */
4116
dmax__ = abs(dx[1]);
4118
for (i__ = 2; i__ <= i__1; ++i__) {
4119
if ((d__1 = dx[i__], abs(d__1)) <= dmax__) {
4123
dmax__ = (d__1 = dx[i__], abs(d__1));
4130
integer izamax_(integer *n, doublecomplex *zx, integer *incx)
4132
/* System generated locals */
4133
integer ret_val, i__1;
4135
/* Local variables */
4136
static integer i__, ix;
4137
static doublereal smax;
4138
extern doublereal dcabs1_(doublecomplex *);
4142
finds the index of element having max. absolute value.
4143
jack dongarra, 1/15/85.
4144
modified 3/93 to return if incx .le. 0.
4145
modified 12/3/93, array(1) declarations changed to array(*)
4149
/* Parameter adjustments */
4154
if (*n < 1 || *incx <= 0) {
4165
/* code for increment not equal to 1 */
4168
smax = dcabs1_(&zx[1]);
4171
for (i__ = 2; i__ <= i__1; ++i__) {
4172
if (dcabs1_(&zx[ix]) <= smax) {
4176
smax = dcabs1_(&zx[ix]);
4183
/* code for increment equal to 1 */
4186
smax = dcabs1_(&zx[1]);
4188
for (i__ = 2; i__ <= i__1; ++i__) {
4189
if (dcabs1_(&zx[i__]) <= smax) {
4193
smax = dcabs1_(&zx[i__]);
4200
logical lsame_(char *ca, char *cb)
4202
/* System generated locals */
4205
/* Local variables */
4206
static integer inta, intb, zcode;
4210
-- LAPACK auxiliary routine (version 3.0) --
4211
Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,
4212
Courant Institute, Argonne National Lab, and Rice University
4219
LSAME returns .TRUE. if CA is the same letter as CB regardless of
4225
CA (input) CHARACTER*1
4226
CB (input) CHARACTER*1
4227
CA and CB specify the single characters to be compared.
4229
=====================================================================
4232
Test if the characters are equal
4235
ret_val = *(unsigned char *)ca == *(unsigned char *)cb;
4240
/* Now test for equivalence if both characters are alphabetic. */
4245
Use 'Z' rather than 'A' so that ASCII can be detected on Prime
4246
machines, on which ICHAR returns a value with bit 8 set.
4247
ICHAR('A') on Prime machines returns 193 which is the same as
4248
ICHAR('A') on an EBCDIC machine.
4251
inta = *(unsigned char *)ca;
4252
intb = *(unsigned char *)cb;
4254
if (zcode == 90 || zcode == 122) {
4257
ASCII is assumed - ZCODE is the ASCII code of either lower or
4261
if ((inta >= 97 && inta <= 122)) {
4264
if ((intb >= 97 && intb <= 122)) {
4268
} else if (zcode == 233 || zcode == 169) {
4271
EBCDIC is assumed - ZCODE is the EBCDIC code of either lower or
4275
if ((inta >= 129 && inta <= 137) || (inta >= 145 && inta <= 153) || (
4276
inta >= 162 && inta <= 169)) {
4279
if ((intb >= 129 && intb <= 137) || (intb >= 145 && intb <= 153) || (
4280
intb >= 162 && intb <= 169)) {
4284
} else if (zcode == 218 || zcode == 250) {
4287
ASCII is assumed, on Prime machines - ZCODE is the ASCII code
4288
plus 128 of either lower or upper case 'Z'.
4291
if ((inta >= 225 && inta <= 250)) {
4294
if ((intb >= 225 && intb <= 250)) {
4298
ret_val = inta == intb;
4309
/* Subroutine */ int xerbla_(char *srname, integer *info)
4311
/* Format strings */
4312
static char fmt_9999[] = "(\002 ** On entry to \002,a6,\002 parameter nu"
4313
"mber \002,i2,\002 had \002,\002an illegal value\002)";
4315
/* Builtin functions */
4316
integer s_wsfe(cilist *), do_fio(integer *, char *, ftnlen), e_wsfe(void);
4317
/* Subroutine */ int s_stop(char *, ftnlen);
4319
/* Fortran I/O blocks */
4320
static cilist io___147 = { 0, 6, 0, fmt_9999, 0 };
4324
-- LAPACK auxiliary routine (preliminary version) --
4325
Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,
4326
Courant Institute, Argonne National Lab, and Rice University
4333
XERBLA is an error handler for the LAPACK routines.
4334
It is called by an LAPACK routine if an input parameter has an
4335
invalid value. A message is printed and execution stops.
4337
Installers may consider modifying the STOP statement in order to
4338
call system-specific exception-handling facilities.
4343
SRNAME (input) CHARACTER*6
4344
The name of the routine which called XERBLA.
4346
INFO (input) INTEGER
4347
The position of the invalid parameter in the parameter list
4348
of the calling routine.
4353
do_fio(&c__1, srname, (ftnlen)6);
4354
do_fio(&c__1, (char *)&(*info), (ftnlen)sizeof(integer));
4357
s_stop("", (ftnlen)0);
4365
/* Subroutine */ int zaxpy_(integer *n, doublecomplex *za, doublecomplex *zx,
4366
integer *incx, doublecomplex *zy, integer *incy)
4368
/* System generated locals */
4369
integer i__1, i__2, i__3, i__4;
4370
doublecomplex z__1, z__2;
4372
/* Local variables */
4373
static integer i__, ix, iy;
4374
extern doublereal dcabs1_(doublecomplex *);
4378
constant times a vector plus a vector.
4379
jack dongarra, 3/11/78.
4380
modified 12/3/93, array(1) declarations changed to array(*)
4383
/* Parameter adjustments */
4391
if (dcabs1_(za) == 0.) {
4394
if ((*incx == 1 && *incy == 1)) {
4399
code for unequal increments or equal increments
4406
ix = (-(*n) + 1) * *incx + 1;
4409
iy = (-(*n) + 1) * *incy + 1;
4412
for (i__ = 1; i__ <= i__1; ++i__) {
4416
z__2.r = za->r * zx[i__4].r - za->i * zx[i__4].i, z__2.i = za->r * zx[
4417
i__4].i + za->i * zx[i__4].r;
4418
z__1.r = zy[i__3].r + z__2.r, z__1.i = zy[i__3].i + z__2.i;
4419
zy[i__2].r = z__1.r, zy[i__2].i = z__1.i;
4426
/* code for both increments equal to 1 */
4430
for (i__ = 1; i__ <= i__1; ++i__) {
4434
z__2.r = za->r * zx[i__4].r - za->i * zx[i__4].i, z__2.i = za->r * zx[
4435
i__4].i + za->i * zx[i__4].r;
4436
z__1.r = zy[i__3].r + z__2.r, z__1.i = zy[i__3].i + z__2.i;
4437
zy[i__2].r = z__1.r, zy[i__2].i = z__1.i;
4443
/* Subroutine */ int zcopy_(integer *n, doublecomplex *zx, integer *incx,
4444
doublecomplex *zy, integer *incy)
4446
/* System generated locals */
4447
integer i__1, i__2, i__3;
4449
/* Local variables */
4450
static integer i__, ix, iy;
4454
copies a vector, x, to a vector, y.
4455
jack dongarra, linpack, 4/11/78.
4456
modified 12/3/93, array(1) declarations changed to array(*)
4460
/* Parameter adjustments */
4468
if ((*incx == 1 && *incy == 1)) {
4473
code for unequal increments or equal increments
4480
ix = (-(*n) + 1) * *incx + 1;
4483
iy = (-(*n) + 1) * *incy + 1;
4486
for (i__ = 1; i__ <= i__1; ++i__) {
4489
zy[i__2].r = zx[i__3].r, zy[i__2].i = zx[i__3].i;
4496
/* code for both increments equal to 1 */
4500
for (i__ = 1; i__ <= i__1; ++i__) {
4503
zy[i__2].r = zx[i__3].r, zy[i__2].i = zx[i__3].i;
4509
/* Double Complex */ VOID zdotc_(doublecomplex * ret_val, integer *n,
4510
doublecomplex *zx, integer *incx, doublecomplex *zy, integer *incy)
4512
/* System generated locals */
4514
doublecomplex z__1, z__2, z__3;
4516
/* Builtin functions */
4517
void d_cnjg(doublecomplex *, doublecomplex *);
4519
/* Local variables */
4520
static integer i__, ix, iy;
4521
static doublecomplex ztemp;
4525
forms the dot product of a vector.
4526
jack dongarra, 3/11/78.
4527
modified 12/3/93, array(1) declarations changed to array(*)
4530
/* Parameter adjustments */
4535
ztemp.r = 0., ztemp.i = 0.;
4536
ret_val->r = 0., ret_val->i = 0.;
4540
if ((*incx == 1 && *incy == 1)) {
4545
code for unequal increments or equal increments
4552
ix = (-(*n) + 1) * *incx + 1;
4555
iy = (-(*n) + 1) * *incy + 1;
4558
for (i__ = 1; i__ <= i__1; ++i__) {
4559
d_cnjg(&z__3, &zx[ix]);
4561
z__2.r = z__3.r * zy[i__2].r - z__3.i * zy[i__2].i, z__2.i = z__3.r *
4562
zy[i__2].i + z__3.i * zy[i__2].r;
4563
z__1.r = ztemp.r + z__2.r, z__1.i = ztemp.i + z__2.i;
4564
ztemp.r = z__1.r, ztemp.i = z__1.i;
4569
ret_val->r = ztemp.r, ret_val->i = ztemp.i;
4572
/* code for both increments equal to 1 */
4576
for (i__ = 1; i__ <= i__1; ++i__) {
4577
d_cnjg(&z__3, &zx[i__]);
4579
z__2.r = z__3.r * zy[i__2].r - z__3.i * zy[i__2].i, z__2.i = z__3.r *
4580
zy[i__2].i + z__3.i * zy[i__2].r;
4581
z__1.r = ztemp.r + z__2.r, z__1.i = ztemp.i + z__2.i;
4582
ztemp.r = z__1.r, ztemp.i = z__1.i;
4585
ret_val->r = ztemp.r, ret_val->i = ztemp.i;
4589
/* Double Complex */ VOID zdotu_(doublecomplex * ret_val, integer *n,
4590
doublecomplex *zx, integer *incx, doublecomplex *zy, integer *incy)
4592
/* System generated locals */
4593
integer i__1, i__2, i__3;
4594
doublecomplex z__1, z__2;
4596
/* Local variables */
4597
static integer i__, ix, iy;
4598
static doublecomplex ztemp;
4602
forms the dot product of two vectors.
4603
jack dongarra, 3/11/78.
4604
modified 12/3/93, array(1) declarations changed to array(*)
4607
/* Parameter adjustments */
4612
ztemp.r = 0., ztemp.i = 0.;
4613
ret_val->r = 0., ret_val->i = 0.;
4617
if ((*incx == 1 && *incy == 1)) {
4622
code for unequal increments or equal increments
4629
ix = (-(*n) + 1) * *incx + 1;
4632
iy = (-(*n) + 1) * *incy + 1;
4635
for (i__ = 1; i__ <= i__1; ++i__) {
4638
z__2.r = zx[i__2].r * zy[i__3].r - zx[i__2].i * zy[i__3].i, z__2.i =
4639
zx[i__2].r * zy[i__3].i + zx[i__2].i * zy[i__3].r;
4640
z__1.r = ztemp.r + z__2.r, z__1.i = ztemp.i + z__2.i;
4641
ztemp.r = z__1.r, ztemp.i = z__1.i;
4646
ret_val->r = ztemp.r, ret_val->i = ztemp.i;
4649
/* code for both increments equal to 1 */
4653
for (i__ = 1; i__ <= i__1; ++i__) {
4656
z__2.r = zx[i__2].r * zy[i__3].r - zx[i__2].i * zy[i__3].i, z__2.i =
4657
zx[i__2].r * zy[i__3].i + zx[i__2].i * zy[i__3].r;
4658
z__1.r = ztemp.r + z__2.r, z__1.i = ztemp.i + z__2.i;
4659
ztemp.r = z__1.r, ztemp.i = z__1.i;
4662
ret_val->r = ztemp.r, ret_val->i = ztemp.i;
4666
/* Subroutine */ int zdscal_(integer *n, doublereal *da, doublecomplex *zx,
4669
/* System generated locals */
4670
integer i__1, i__2, i__3;
4671
doublecomplex z__1, z__2;
4673
/* Local variables */
4674
static integer i__, ix;
4678
scales a vector by a constant.
4679
jack dongarra, 3/11/78.
4680
modified 3/93 to return if incx .le. 0.
4681
modified 12/3/93, array(1) declarations changed to array(*)
4685
/* Parameter adjustments */
4689
if (*n <= 0 || *incx <= 0) {
4696
/* code for increment not equal to 1 */
4700
for (i__ = 1; i__ <= i__1; ++i__) {
4702
z__2.r = *da, z__2.i = 0.;
4704
z__1.r = z__2.r * zx[i__3].r - z__2.i * zx[i__3].i, z__1.i = z__2.r *
4705
zx[i__3].i + z__2.i * zx[i__3].r;
4706
zx[i__2].r = z__1.r, zx[i__2].i = z__1.i;
4712
/* code for increment equal to 1 */
4716
for (i__ = 1; i__ <= i__1; ++i__) {
4718
z__2.r = *da, z__2.i = 0.;
4720
z__1.r = z__2.r * zx[i__3].r - z__2.i * zx[i__3].i, z__1.i = z__2.r *
4721
zx[i__3].i + z__2.i * zx[i__3].r;
4722
zx[i__2].r = z__1.r, zx[i__2].i = z__1.i;
4728
/* Subroutine */ int zgemm_(char *transa, char *transb, integer *m, integer *
4729
n, integer *k, doublecomplex *alpha, doublecomplex *a, integer *lda,
4730
doublecomplex *b, integer *ldb, doublecomplex *beta, doublecomplex *
4733
/* System generated locals */
4734
integer a_dim1, a_offset, b_dim1, b_offset, c_dim1, c_offset, i__1, i__2,
4735
i__3, i__4, i__5, i__6;
4736
doublecomplex z__1, z__2, z__3, z__4;
4738
/* Builtin functions */
4739
void d_cnjg(doublecomplex *, doublecomplex *);
4741
/* Local variables */
4742
static integer i__, j, l, info;
4743
static logical nota, notb;
4744
static doublecomplex temp;
4745
static logical conja, conjb;
4746
static integer ncola;
4747
extern logical lsame_(char *, char *);
4748
static integer nrowa, nrowb;
4749
extern /* Subroutine */ int xerbla_(char *, integer *);
4756
ZGEMM performs one of the matrix-matrix operations
4758
C := alpha*op( A )*op( B ) + beta*C,
4760
where op( X ) is one of
4762
op( X ) = X or op( X ) = X' or op( X ) = conjg( X' ),
4764
alpha and beta are scalars, and A, B and C are matrices, with op( A )
4765
an m by k matrix, op( B ) a k by n matrix and C an m by n matrix.
4770
TRANSA - CHARACTER*1.
4771
On entry, TRANSA specifies the form of op( A ) to be used in
4772
the matrix multiplication as follows:
4774
TRANSA = 'N' or 'n', op( A ) = A.
4776
TRANSA = 'T' or 't', op( A ) = A'.
4778
TRANSA = 'C' or 'c', op( A ) = conjg( A' ).
4782
TRANSB - CHARACTER*1.
4783
On entry, TRANSB specifies the form of op( B ) to be used in
4784
the matrix multiplication as follows:
4786
TRANSB = 'N' or 'n', op( B ) = B.
4788
TRANSB = 'T' or 't', op( B ) = B'.
4790
TRANSB = 'C' or 'c', op( B ) = conjg( B' ).
4795
On entry, M specifies the number of rows of the matrix
4796
op( A ) and of the matrix C. M must be at least zero.
4800
On entry, N specifies the number of columns of the matrix
4801
op( B ) and the number of columns of the matrix C. N must be
4806
On entry, K specifies the number of columns of the matrix
4807
op( A ) and the number of rows of the matrix op( B ). K must
4811
ALPHA - COMPLEX*16 .
4812
On entry, ALPHA specifies the scalar alpha.
4815
A - COMPLEX*16 array of DIMENSION ( LDA, ka ), where ka is
4816
k when TRANSA = 'N' or 'n', and is m otherwise.
4817
Before entry with TRANSA = 'N' or 'n', the leading m by k
4818
part of the array A must contain the matrix A, otherwise
4819
the leading k by m part of the array A must contain the
4824
On entry, LDA specifies the first dimension of A as declared
4825
in the calling (sub) program. When TRANSA = 'N' or 'n' then
4826
LDA must be at least max( 1, m ), otherwise LDA must be at
4830
B - COMPLEX*16 array of DIMENSION ( LDB, kb ), where kb is
4831
n when TRANSB = 'N' or 'n', and is k otherwise.
4832
Before entry with TRANSB = 'N' or 'n', the leading k by n
4833
part of the array B must contain the matrix B, otherwise
4834
the leading n by k part of the array B must contain the
4839
On entry, LDB specifies the first dimension of B as declared
4840
in the calling (sub) program. When TRANSB = 'N' or 'n' then
4841
LDB must be at least max( 1, k ), otherwise LDB must be at
4846
On entry, BETA specifies the scalar beta. When BETA is
4847
supplied as zero then C need not be set on input.
4850
C - COMPLEX*16 array of DIMENSION ( LDC, n ).
4851
Before entry, the leading m by n part of the array C must
4852
contain the matrix C, except when beta is zero, in which
4853
case C need not be set on entry.
4854
On exit, the array C is overwritten by the m by n matrix
4855
( alpha*op( A )*op( B ) + beta*C ).
4858
On entry, LDC specifies the first dimension of C as declared
4859
in the calling (sub) program. LDC must be at least
4864
Level 3 Blas routine.
4866
-- Written on 8-February-1989.
4867
Jack Dongarra, Argonne National Laboratory.
4868
Iain Duff, AERE Harwell.
4869
Jeremy Du Croz, Numerical Algorithms Group Ltd.
4870
Sven Hammarling, Numerical Algorithms Group Ltd.
4873
Set NOTA and NOTB as true if A and B respectively are not
4874
conjugated or transposed, set CONJA and CONJB as true if A and
4875
B respectively are to be transposed but not conjugated and set
4876
NROWA, NCOLA and NROWB as the number of rows and columns of A
4877
and the number of rows of B respectively.
4880
/* Parameter adjustments */
4882
a_offset = 1 + a_dim1 * 1;
4885
b_offset = 1 + b_dim1 * 1;
4888
c_offset = 1 + c_dim1 * 1;
4892
nota = lsame_(transa, "N");
4893
notb = lsame_(transb, "N");
4894
conja = lsame_(transa, "C");
4895
conjb = lsame_(transb, "C");
4909
/* Test the input parameters. */
4912
if (((! nota && ! conja) && ! lsame_(transa, "T")))
4915
} else if (((! notb && ! conjb) && ! lsame_(transb, "T"))) {
4917
} else if (*m < 0) {
4919
} else if (*n < 0) {
4921
} else if (*k < 0) {
4923
} else if (*lda < max(1,nrowa)) {
4925
} else if (*ldb < max(1,nrowb)) {
4927
} else if (*ldc < max(1,*m)) {
4931
xerbla_("ZGEMM ", &info);
4935
/* Quick return if possible. */
4937
if (*m == 0 || *n == 0 || (((alpha->r == 0. && alpha->i == 0.) || *k == 0)
4938
&& ((beta->r == 1. && beta->i == 0.)))) {
4942
/* And when alpha.eq.zero. */
4944
if ((alpha->r == 0. && alpha->i == 0.)) {
4945
if ((beta->r == 0. && beta->i == 0.)) {
4947
for (j = 1; j <= i__1; ++j) {
4949
for (i__ = 1; i__ <= i__2; ++i__) {
4950
i__3 = i__ + j * c_dim1;
4951
c__[i__3].r = 0., c__[i__3].i = 0.;
4958
for (j = 1; j <= i__1; ++j) {
4960
for (i__ = 1; i__ <= i__2; ++i__) {
4961
i__3 = i__ + j * c_dim1;
4962
i__4 = i__ + j * c_dim1;
4963
z__1.r = beta->r * c__[i__4].r - beta->i * c__[i__4].i,
4964
z__1.i = beta->r * c__[i__4].i + beta->i * c__[
4966
c__[i__3].r = z__1.r, c__[i__3].i = z__1.i;
4975
/* Start the operations. */
4980
/* Form C := alpha*A*B + beta*C. */
4983
for (j = 1; j <= i__1; ++j) {
4984
if ((beta->r == 0. && beta->i == 0.)) {
4986
for (i__ = 1; i__ <= i__2; ++i__) {
4987
i__3 = i__ + j * c_dim1;
4988
c__[i__3].r = 0., c__[i__3].i = 0.;
4991
} else if (beta->r != 1. || beta->i != 0.) {
4993
for (i__ = 1; i__ <= i__2; ++i__) {
4994
i__3 = i__ + j * c_dim1;
4995
i__4 = i__ + j * c_dim1;
4996
z__1.r = beta->r * c__[i__4].r - beta->i * c__[i__4]
4997
.i, z__1.i = beta->r * c__[i__4].i + beta->i *
4999
c__[i__3].r = z__1.r, c__[i__3].i = z__1.i;
5004
for (l = 1; l <= i__2; ++l) {
5005
i__3 = l + j * b_dim1;
5006
if (b[i__3].r != 0. || b[i__3].i != 0.) {
5007
i__3 = l + j * b_dim1;
5008
z__1.r = alpha->r * b[i__3].r - alpha->i * b[i__3].i,
5009
z__1.i = alpha->r * b[i__3].i + alpha->i * b[
5011
temp.r = z__1.r, temp.i = z__1.i;
5013
for (i__ = 1; i__ <= i__3; ++i__) {
5014
i__4 = i__ + j * c_dim1;
5015
i__5 = i__ + j * c_dim1;
5016
i__6 = i__ + l * a_dim1;
5017
z__2.r = temp.r * a[i__6].r - temp.i * a[i__6].i,
5018
z__2.i = temp.r * a[i__6].i + temp.i * a[
5020
z__1.r = c__[i__5].r + z__2.r, z__1.i = c__[i__5]
5022
c__[i__4].r = z__1.r, c__[i__4].i = z__1.i;
5032
/* Form C := alpha*conjg( A' )*B + beta*C. */
5035
for (j = 1; j <= i__1; ++j) {
5037
for (i__ = 1; i__ <= i__2; ++i__) {
5038
temp.r = 0., temp.i = 0.;
5040
for (l = 1; l <= i__3; ++l) {
5041
d_cnjg(&z__3, &a[l + i__ * a_dim1]);
5042
i__4 = l + j * b_dim1;
5043
z__2.r = z__3.r * b[i__4].r - z__3.i * b[i__4].i,
5044
z__2.i = z__3.r * b[i__4].i + z__3.i * b[i__4]
5046
z__1.r = temp.r + z__2.r, z__1.i = temp.i + z__2.i;
5047
temp.r = z__1.r, temp.i = z__1.i;
5050
if ((beta->r == 0. && beta->i == 0.)) {
5051
i__3 = i__ + j * c_dim1;
5052
z__1.r = alpha->r * temp.r - alpha->i * temp.i,
5053
z__1.i = alpha->r * temp.i + alpha->i *
5055
c__[i__3].r = z__1.r, c__[i__3].i = z__1.i;
5057
i__3 = i__ + j * c_dim1;
5058
z__2.r = alpha->r * temp.r - alpha->i * temp.i,
5059
z__2.i = alpha->r * temp.i + alpha->i *
5061
i__4 = i__ + j * c_dim1;
5062
z__3.r = beta->r * c__[i__4].r - beta->i * c__[i__4]
5063
.i, z__3.i = beta->r * c__[i__4].i + beta->i *
5065
z__1.r = z__2.r + z__3.r, z__1.i = z__2.i + z__3.i;
5066
c__[i__3].r = z__1.r, c__[i__3].i = z__1.i;
5074
/* Form C := alpha*A'*B + beta*C */
5077
for (j = 1; j <= i__1; ++j) {
5079
for (i__ = 1; i__ <= i__2; ++i__) {
5080
temp.r = 0., temp.i = 0.;
5082
for (l = 1; l <= i__3; ++l) {
5083
i__4 = l + i__ * a_dim1;
5084
i__5 = l + j * b_dim1;
5085
z__2.r = a[i__4].r * b[i__5].r - a[i__4].i * b[i__5]
5086
.i, z__2.i = a[i__4].r * b[i__5].i + a[i__4]
5088
z__1.r = temp.r + z__2.r, z__1.i = temp.i + z__2.i;
5089
temp.r = z__1.r, temp.i = z__1.i;
5092
if ((beta->r == 0. && beta->i == 0.)) {
5093
i__3 = i__ + j * c_dim1;
5094
z__1.r = alpha->r * temp.r - alpha->i * temp.i,
5095
z__1.i = alpha->r * temp.i + alpha->i *
5097
c__[i__3].r = z__1.r, c__[i__3].i = z__1.i;
5099
i__3 = i__ + j * c_dim1;
5100
z__2.r = alpha->r * temp.r - alpha->i * temp.i,
5101
z__2.i = alpha->r * temp.i + alpha->i *
5103
i__4 = i__ + j * c_dim1;
5104
z__3.r = beta->r * c__[i__4].r - beta->i * c__[i__4]
5105
.i, z__3.i = beta->r * c__[i__4].i + beta->i *
5107
z__1.r = z__2.r + z__3.r, z__1.i = z__2.i + z__3.i;
5108
c__[i__3].r = z__1.r, c__[i__3].i = z__1.i;
5118
/* Form C := alpha*A*conjg( B' ) + beta*C. */
5121
for (j = 1; j <= i__1; ++j) {
5122
if ((beta->r == 0. && beta->i == 0.)) {
5124
for (i__ = 1; i__ <= i__2; ++i__) {
5125
i__3 = i__ + j * c_dim1;
5126
c__[i__3].r = 0., c__[i__3].i = 0.;
5129
} else if (beta->r != 1. || beta->i != 0.) {
5131
for (i__ = 1; i__ <= i__2; ++i__) {
5132
i__3 = i__ + j * c_dim1;
5133
i__4 = i__ + j * c_dim1;
5134
z__1.r = beta->r * c__[i__4].r - beta->i * c__[i__4]
5135
.i, z__1.i = beta->r * c__[i__4].i + beta->i *
5137
c__[i__3].r = z__1.r, c__[i__3].i = z__1.i;
5142
for (l = 1; l <= i__2; ++l) {
5143
i__3 = j + l * b_dim1;
5144
if (b[i__3].r != 0. || b[i__3].i != 0.) {
5145
d_cnjg(&z__2, &b[j + l * b_dim1]);
5146
z__1.r = alpha->r * z__2.r - alpha->i * z__2.i,
5147
z__1.i = alpha->r * z__2.i + alpha->i *
5149
temp.r = z__1.r, temp.i = z__1.i;
5151
for (i__ = 1; i__ <= i__3; ++i__) {
5152
i__4 = i__ + j * c_dim1;
5153
i__5 = i__ + j * c_dim1;
5154
i__6 = i__ + l * a_dim1;
5155
z__2.r = temp.r * a[i__6].r - temp.i * a[i__6].i,
5156
z__2.i = temp.r * a[i__6].i + temp.i * a[
5158
z__1.r = c__[i__5].r + z__2.r, z__1.i = c__[i__5]
5160
c__[i__4].r = z__1.r, c__[i__4].i = z__1.i;
5170
/* Form C := alpha*A*B' + beta*C */
5173
for (j = 1; j <= i__1; ++j) {
5174
if ((beta->r == 0. && beta->i == 0.)) {
5176
for (i__ = 1; i__ <= i__2; ++i__) {
5177
i__3 = i__ + j * c_dim1;
5178
c__[i__3].r = 0., c__[i__3].i = 0.;
5181
} else if (beta->r != 1. || beta->i != 0.) {
5183
for (i__ = 1; i__ <= i__2; ++i__) {
5184
i__3 = i__ + j * c_dim1;
5185
i__4 = i__ + j * c_dim1;
5186
z__1.r = beta->r * c__[i__4].r - beta->i * c__[i__4]
5187
.i, z__1.i = beta->r * c__[i__4].i + beta->i *
5189
c__[i__3].r = z__1.r, c__[i__3].i = z__1.i;
5194
for (l = 1; l <= i__2; ++l) {
5195
i__3 = j + l * b_dim1;
5196
if (b[i__3].r != 0. || b[i__3].i != 0.) {
5197
i__3 = j + l * b_dim1;
5198
z__1.r = alpha->r * b[i__3].r - alpha->i * b[i__3].i,
5199
z__1.i = alpha->r * b[i__3].i + alpha->i * b[
5201
temp.r = z__1.r, temp.i = z__1.i;
5203
for (i__ = 1; i__ <= i__3; ++i__) {
5204
i__4 = i__ + j * c_dim1;
5205
i__5 = i__ + j * c_dim1;
5206
i__6 = i__ + l * a_dim1;
5207
z__2.r = temp.r * a[i__6].r - temp.i * a[i__6].i,
5208
z__2.i = temp.r * a[i__6].i + temp.i * a[
5210
z__1.r = c__[i__5].r + z__2.r, z__1.i = c__[i__5]
5212
c__[i__4].r = z__1.r, c__[i__4].i = z__1.i;
5224
/* Form C := alpha*conjg( A' )*conjg( B' ) + beta*C. */
5227
for (j = 1; j <= i__1; ++j) {
5229
for (i__ = 1; i__ <= i__2; ++i__) {
5230
temp.r = 0., temp.i = 0.;
5232
for (l = 1; l <= i__3; ++l) {
5233
d_cnjg(&z__3, &a[l + i__ * a_dim1]);
5234
d_cnjg(&z__4, &b[j + l * b_dim1]);
5235
z__2.r = z__3.r * z__4.r - z__3.i * z__4.i, z__2.i =
5236
z__3.r * z__4.i + z__3.i * z__4.r;
5237
z__1.r = temp.r + z__2.r, z__1.i = temp.i + z__2.i;
5238
temp.r = z__1.r, temp.i = z__1.i;
5241
if ((beta->r == 0. && beta->i == 0.)) {
5242
i__3 = i__ + j * c_dim1;
5243
z__1.r = alpha->r * temp.r - alpha->i * temp.i,
5244
z__1.i = alpha->r * temp.i + alpha->i *
5246
c__[i__3].r = z__1.r, c__[i__3].i = z__1.i;
5248
i__3 = i__ + j * c_dim1;
5249
z__2.r = alpha->r * temp.r - alpha->i * temp.i,
5250
z__2.i = alpha->r * temp.i + alpha->i *
5252
i__4 = i__ + j * c_dim1;
5253
z__3.r = beta->r * c__[i__4].r - beta->i * c__[i__4]
5254
.i, z__3.i = beta->r * c__[i__4].i + beta->i *
5256
z__1.r = z__2.r + z__3.r, z__1.i = z__2.i + z__3.i;
5257
c__[i__3].r = z__1.r, c__[i__3].i = z__1.i;
5265
/* Form C := alpha*conjg( A' )*B' + beta*C */
5268
for (j = 1; j <= i__1; ++j) {
5270
for (i__ = 1; i__ <= i__2; ++i__) {
5271
temp.r = 0., temp.i = 0.;
5273
for (l = 1; l <= i__3; ++l) {
5274
d_cnjg(&z__3, &a[l + i__ * a_dim1]);
5275
i__4 = j + l * b_dim1;
5276
z__2.r = z__3.r * b[i__4].r - z__3.i * b[i__4].i,
5277
z__2.i = z__3.r * b[i__4].i + z__3.i * b[i__4]
5279
z__1.r = temp.r + z__2.r, z__1.i = temp.i + z__2.i;
5280
temp.r = z__1.r, temp.i = z__1.i;
5283
if ((beta->r == 0. && beta->i == 0.)) {
5284
i__3 = i__ + j * c_dim1;
5285
z__1.r = alpha->r * temp.r - alpha->i * temp.i,
5286
z__1.i = alpha->r * temp.i + alpha->i *
5288
c__[i__3].r = z__1.r, c__[i__3].i = z__1.i;
5290
i__3 = i__ + j * c_dim1;
5291
z__2.r = alpha->r * temp.r - alpha->i * temp.i,
5292
z__2.i = alpha->r * temp.i + alpha->i *
5294
i__4 = i__ + j * c_dim1;
5295
z__3.r = beta->r * c__[i__4].r - beta->i * c__[i__4]
5296
.i, z__3.i = beta->r * c__[i__4].i + beta->i *
5298
z__1.r = z__2.r + z__3.r, z__1.i = z__2.i + z__3.i;
5299
c__[i__3].r = z__1.r, c__[i__3].i = z__1.i;
5309
/* Form C := alpha*A'*conjg( B' ) + beta*C */
5312
for (j = 1; j <= i__1; ++j) {
5314
for (i__ = 1; i__ <= i__2; ++i__) {
5315
temp.r = 0., temp.i = 0.;
5317
for (l = 1; l <= i__3; ++l) {
5318
i__4 = l + i__ * a_dim1;
5319
d_cnjg(&z__3, &b[j + l * b_dim1]);
5320
z__2.r = a[i__4].r * z__3.r - a[i__4].i * z__3.i,
5321
z__2.i = a[i__4].r * z__3.i + a[i__4].i *
5323
z__1.r = temp.r + z__2.r, z__1.i = temp.i + z__2.i;
5324
temp.r = z__1.r, temp.i = z__1.i;
5327
if ((beta->r == 0. && beta->i == 0.)) {
5328
i__3 = i__ + j * c_dim1;
5329
z__1.r = alpha->r * temp.r - alpha->i * temp.i,
5330
z__1.i = alpha->r * temp.i + alpha->i *
5332
c__[i__3].r = z__1.r, c__[i__3].i = z__1.i;
5334
i__3 = i__ + j * c_dim1;
5335
z__2.r = alpha->r * temp.r - alpha->i * temp.i,
5336
z__2.i = alpha->r * temp.i + alpha->i *
5338
i__4 = i__ + j * c_dim1;
5339
z__3.r = beta->r * c__[i__4].r - beta->i * c__[i__4]
5340
.i, z__3.i = beta->r * c__[i__4].i + beta->i *
5342
z__1.r = z__2.r + z__3.r, z__1.i = z__2.i + z__3.i;
5343
c__[i__3].r = z__1.r, c__[i__3].i = z__1.i;
5351
/* Form C := alpha*A'*B' + beta*C */
5354
for (j = 1; j <= i__1; ++j) {
5356
for (i__ = 1; i__ <= i__2; ++i__) {
5357
temp.r = 0., temp.i = 0.;
5359
for (l = 1; l <= i__3; ++l) {
5360
i__4 = l + i__ * a_dim1;
5361
i__5 = j + l * b_dim1;
5362
z__2.r = a[i__4].r * b[i__5].r - a[i__4].i * b[i__5]
5363
.i, z__2.i = a[i__4].r * b[i__5].i + a[i__4]
5365
z__1.r = temp.r + z__2.r, z__1.i = temp.i + z__2.i;
5366
temp.r = z__1.r, temp.i = z__1.i;
5369
if ((beta->r == 0. && beta->i == 0.)) {
5370
i__3 = i__ + j * c_dim1;
5371
z__1.r = alpha->r * temp.r - alpha->i * temp.i,
5372
z__1.i = alpha->r * temp.i + alpha->i *
5374
c__[i__3].r = z__1.r, c__[i__3].i = z__1.i;
5376
i__3 = i__ + j * c_dim1;
5377
z__2.r = alpha->r * temp.r - alpha->i * temp.i,
5378
z__2.i = alpha->r * temp.i + alpha->i *
5380
i__4 = i__ + j * c_dim1;
5381
z__3.r = beta->r * c__[i__4].r - beta->i * c__[i__4]
5382
.i, z__3.i = beta->r * c__[i__4].i + beta->i *
5384
z__1.r = z__2.r + z__3.r, z__1.i = z__2.i + z__3.i;
5385
c__[i__3].r = z__1.r, c__[i__3].i = z__1.i;
5396
/* End of ZGEMM . */
5400
/* Subroutine */ int zgemv_(char *trans, integer *m, integer *n,
5401
doublecomplex *alpha, doublecomplex *a, integer *lda, doublecomplex *
5402
x, integer *incx, doublecomplex *beta, doublecomplex *y, integer *
5405
/* System generated locals */
5406
integer a_dim1, a_offset, i__1, i__2, i__3, i__4, i__5;
5407
doublecomplex z__1, z__2, z__3;
5409
/* Builtin functions */
5410
void d_cnjg(doublecomplex *, doublecomplex *);
5412
/* Local variables */
5413
static integer i__, j, ix, iy, jx, jy, kx, ky, info;
5414
static doublecomplex temp;
5415
static integer lenx, leny;
5416
extern logical lsame_(char *, char *);
5417
extern /* Subroutine */ int xerbla_(char *, integer *);
5418
static logical noconj;
5425
ZGEMV performs one of the matrix-vector operations
5427
y := alpha*A*x + beta*y, or y := alpha*A'*x + beta*y, or
5429
y := alpha*conjg( A' )*x + beta*y,
5431
where alpha and beta are scalars, x and y are vectors and A is an
5437
TRANS - CHARACTER*1.
5438
On entry, TRANS specifies the operation to be performed as
5441
TRANS = 'N' or 'n' y := alpha*A*x + beta*y.
5443
TRANS = 'T' or 't' y := alpha*A'*x + beta*y.
5445
TRANS = 'C' or 'c' y := alpha*conjg( A' )*x + beta*y.
5450
On entry, M specifies the number of rows of the matrix A.
5451
M must be at least zero.
5455
On entry, N specifies the number of columns of the matrix A.
5456
N must be at least zero.
5459
ALPHA - COMPLEX*16 .
5460
On entry, ALPHA specifies the scalar alpha.
5463
A - COMPLEX*16 array of DIMENSION ( LDA, n ).
5464
Before entry, the leading m by n part of the array A must
5465
contain the matrix of coefficients.
5469
On entry, LDA specifies the first dimension of A as declared
5470
in the calling (sub) program. LDA must be at least
5474
X - COMPLEX*16 array of DIMENSION at least
5475
( 1 + ( n - 1 )*abs( INCX ) ) when TRANS = 'N' or 'n'
5477
( 1 + ( m - 1 )*abs( INCX ) ) otherwise.
5478
Before entry, the incremented array X must contain the
5483
On entry, INCX specifies the increment for the elements of
5484
X. INCX must not be zero.
5488
On entry, BETA specifies the scalar beta. When BETA is
5489
supplied as zero then Y need not be set on input.
5492
Y - COMPLEX*16 array of DIMENSION at least
5493
( 1 + ( m - 1 )*abs( INCY ) ) when TRANS = 'N' or 'n'
5495
( 1 + ( n - 1 )*abs( INCY ) ) otherwise.
5496
Before entry with BETA non-zero, the incremented array Y
5497
must contain the vector y. On exit, Y is overwritten by the
5501
On entry, INCY specifies the increment for the elements of
5502
Y. INCY must not be zero.
5506
Level 2 Blas routine.
5508
-- Written on 22-October-1986.
5509
Jack Dongarra, Argonne National Lab.
5510
Jeremy Du Croz, Nag Central Office.
5511
Sven Hammarling, Nag Central Office.
5512
Richard Hanson, Sandia National Labs.
5515
Test the input parameters.
5518
/* Parameter adjustments */
5520
a_offset = 1 + a_dim1 * 1;
5527
if (((! lsame_(trans, "N") && ! lsame_(trans, "T")) && ! lsame_(trans, "C"))) {
5529
} else if (*m < 0) {
5531
} else if (*n < 0) {
5533
} else if (*lda < max(1,*m)) {
5535
} else if (*incx == 0) {
5537
} else if (*incy == 0) {
5541
xerbla_("ZGEMV ", &info);
5545
/* Quick return if possible. */
5547
if (*m == 0 || *n == 0 || ((alpha->r == 0. && alpha->i == 0.) && ((
5548
beta->r == 1. && beta->i == 0.)))) {
5552
noconj = lsame_(trans, "T");
5555
Set LENX and LENY, the lengths of the vectors x and y, and set
5556
up the start points in X and Y.
5559
if (lsame_(trans, "N")) {
5569
kx = 1 - (lenx - 1) * *incx;
5574
ky = 1 - (leny - 1) * *incy;
5578
Start the operations. In this version the elements of A are
5579
accessed sequentially with one pass through A.
5581
First form y := beta*y.
5584
if (beta->r != 1. || beta->i != 0.) {
5586
if ((beta->r == 0. && beta->i == 0.)) {
5588
for (i__ = 1; i__ <= i__1; ++i__) {
5590
y[i__2].r = 0., y[i__2].i = 0.;
5595
for (i__ = 1; i__ <= i__1; ++i__) {
5598
z__1.r = beta->r * y[i__3].r - beta->i * y[i__3].i,
5599
z__1.i = beta->r * y[i__3].i + beta->i * y[i__3]
5601
y[i__2].r = z__1.r, y[i__2].i = z__1.i;
5607
if ((beta->r == 0. && beta->i == 0.)) {
5609
for (i__ = 1; i__ <= i__1; ++i__) {
5611
y[i__2].r = 0., y[i__2].i = 0.;
5617
for (i__ = 1; i__ <= i__1; ++i__) {
5620
z__1.r = beta->r * y[i__3].r - beta->i * y[i__3].i,
5621
z__1.i = beta->r * y[i__3].i + beta->i * y[i__3]
5623
y[i__2].r = z__1.r, y[i__2].i = z__1.i;
5630
if ((alpha->r == 0. && alpha->i == 0.)) {
5633
if (lsame_(trans, "N")) {
5635
/* Form y := alpha*A*x + y. */
5640
for (j = 1; j <= i__1; ++j) {
5642
if (x[i__2].r != 0. || x[i__2].i != 0.) {
5644
z__1.r = alpha->r * x[i__2].r - alpha->i * x[i__2].i,
5645
z__1.i = alpha->r * x[i__2].i + alpha->i * x[i__2]
5647
temp.r = z__1.r, temp.i = z__1.i;
5649
for (i__ = 1; i__ <= i__2; ++i__) {
5652
i__5 = i__ + j * a_dim1;
5653
z__2.r = temp.r * a[i__5].r - temp.i * a[i__5].i,
5654
z__2.i = temp.r * a[i__5].i + temp.i * a[i__5]
5656
z__1.r = y[i__4].r + z__2.r, z__1.i = y[i__4].i +
5658
y[i__3].r = z__1.r, y[i__3].i = z__1.i;
5667
for (j = 1; j <= i__1; ++j) {
5669
if (x[i__2].r != 0. || x[i__2].i != 0.) {
5671
z__1.r = alpha->r * x[i__2].r - alpha->i * x[i__2].i,
5672
z__1.i = alpha->r * x[i__2].i + alpha->i * x[i__2]
5674
temp.r = z__1.r, temp.i = z__1.i;
5677
for (i__ = 1; i__ <= i__2; ++i__) {
5680
i__5 = i__ + j * a_dim1;
5681
z__2.r = temp.r * a[i__5].r - temp.i * a[i__5].i,
5682
z__2.i = temp.r * a[i__5].i + temp.i * a[i__5]
5684
z__1.r = y[i__4].r + z__2.r, z__1.i = y[i__4].i +
5686
y[i__3].r = z__1.r, y[i__3].i = z__1.i;
5697
/* Form y := alpha*A'*x + y or y := alpha*conjg( A' )*x + y. */
5702
for (j = 1; j <= i__1; ++j) {
5703
temp.r = 0., temp.i = 0.;
5706
for (i__ = 1; i__ <= i__2; ++i__) {
5707
i__3 = i__ + j * a_dim1;
5709
z__2.r = a[i__3].r * x[i__4].r - a[i__3].i * x[i__4]
5710
.i, z__2.i = a[i__3].r * x[i__4].i + a[i__3]
5712
z__1.r = temp.r + z__2.r, z__1.i = temp.i + z__2.i;
5713
temp.r = z__1.r, temp.i = z__1.i;
5718
for (i__ = 1; i__ <= i__2; ++i__) {
5719
d_cnjg(&z__3, &a[i__ + j * a_dim1]);
5721
z__2.r = z__3.r * x[i__3].r - z__3.i * x[i__3].i,
5722
z__2.i = z__3.r * x[i__3].i + z__3.i * x[i__3]
5724
z__1.r = temp.r + z__2.r, z__1.i = temp.i + z__2.i;
5725
temp.r = z__1.r, temp.i = z__1.i;
5731
z__2.r = alpha->r * temp.r - alpha->i * temp.i, z__2.i =
5732
alpha->r * temp.i + alpha->i * temp.r;
5733
z__1.r = y[i__3].r + z__2.r, z__1.i = y[i__3].i + z__2.i;
5734
y[i__2].r = z__1.r, y[i__2].i = z__1.i;
5740
for (j = 1; j <= i__1; ++j) {
5741
temp.r = 0., temp.i = 0.;
5745
for (i__ = 1; i__ <= i__2; ++i__) {
5746
i__3 = i__ + j * a_dim1;
5748
z__2.r = a[i__3].r * x[i__4].r - a[i__3].i * x[i__4]
5749
.i, z__2.i = a[i__3].r * x[i__4].i + a[i__3]
5751
z__1.r = temp.r + z__2.r, z__1.i = temp.i + z__2.i;
5752
temp.r = z__1.r, temp.i = z__1.i;
5758
for (i__ = 1; i__ <= i__2; ++i__) {
5759
d_cnjg(&z__3, &a[i__ + j * a_dim1]);
5761
z__2.r = z__3.r * x[i__3].r - z__3.i * x[i__3].i,
5762
z__2.i = z__3.r * x[i__3].i + z__3.i * x[i__3]
5764
z__1.r = temp.r + z__2.r, z__1.i = temp.i + z__2.i;
5765
temp.r = z__1.r, temp.i = z__1.i;
5772
z__2.r = alpha->r * temp.r - alpha->i * temp.i, z__2.i =
5773
alpha->r * temp.i + alpha->i * temp.r;
5774
z__1.r = y[i__3].r + z__2.r, z__1.i = y[i__3].i + z__2.i;
5775
y[i__2].r = z__1.r, y[i__2].i = z__1.i;
5784
/* End of ZGEMV . */
5788
/* Subroutine */ int zgerc_(integer *m, integer *n, doublecomplex *alpha,
5789
doublecomplex *x, integer *incx, doublecomplex *y, integer *incy,
5790
doublecomplex *a, integer *lda)
5792
/* System generated locals */
5793
integer a_dim1, a_offset, i__1, i__2, i__3, i__4, i__5;
5794
doublecomplex z__1, z__2;
5796
/* Builtin functions */
5797
void d_cnjg(doublecomplex *, doublecomplex *);
5799
/* Local variables */
5800
static integer i__, j, ix, jy, kx, info;
5801
static doublecomplex temp;
5802
extern /* Subroutine */ int xerbla_(char *, integer *);
5809
ZGERC performs the rank 1 operation
5811
A := alpha*x*conjg( y' ) + A,
5813
where alpha is a scalar, x is an m element vector, y is an n element
5814
vector and A is an m by n matrix.
5820
On entry, M specifies the number of rows of the matrix A.
5821
M must be at least zero.
5825
On entry, N specifies the number of columns of the matrix A.
5826
N must be at least zero.
5829
ALPHA - COMPLEX*16 .
5830
On entry, ALPHA specifies the scalar alpha.
5833
X - COMPLEX*16 array of dimension at least
5834
( 1 + ( m - 1 )*abs( INCX ) ).
5835
Before entry, the incremented array X must contain the m
5840
On entry, INCX specifies the increment for the elements of
5841
X. INCX must not be zero.
5844
Y - COMPLEX*16 array of dimension at least
5845
( 1 + ( n - 1 )*abs( INCY ) ).
5846
Before entry, the incremented array Y must contain the n
5851
On entry, INCY specifies the increment for the elements of
5852
Y. INCY must not be zero.
5855
A - COMPLEX*16 array of DIMENSION ( LDA, n ).
5856
Before entry, the leading m by n part of the array A must
5857
contain the matrix of coefficients. On exit, A is
5858
overwritten by the updated matrix.
5861
On entry, LDA specifies the first dimension of A as declared
5862
in the calling (sub) program. LDA must be at least
5867
Level 2 Blas routine.
5869
-- Written on 22-October-1986.
5870
Jack Dongarra, Argonne National Lab.
5871
Jeremy Du Croz, Nag Central Office.
5872
Sven Hammarling, Nag Central Office.
5873
Richard Hanson, Sandia National Labs.
5876
Test the input parameters.
5879
/* Parameter adjustments */
5883
a_offset = 1 + a_dim1 * 1;
5890
} else if (*n < 0) {
5892
} else if (*incx == 0) {
5894
} else if (*incy == 0) {
5896
} else if (*lda < max(1,*m)) {
5900
xerbla_("ZGERC ", &info);
5904
/* Quick return if possible. */
5906
if (*m == 0 || *n == 0 || (alpha->r == 0. && alpha->i == 0.)) {
5911
Start the operations. In this version the elements of A are
5912
accessed sequentially with one pass through A.
5918
jy = 1 - (*n - 1) * *incy;
5922
for (j = 1; j <= i__1; ++j) {
5924
if (y[i__2].r != 0. || y[i__2].i != 0.) {
5925
d_cnjg(&z__2, &y[jy]);
5926
z__1.r = alpha->r * z__2.r - alpha->i * z__2.i, z__1.i =
5927
alpha->r * z__2.i + alpha->i * z__2.r;
5928
temp.r = z__1.r, temp.i = z__1.i;
5930
for (i__ = 1; i__ <= i__2; ++i__) {
5931
i__3 = i__ + j * a_dim1;
5932
i__4 = i__ + j * a_dim1;
5934
z__2.r = x[i__5].r * temp.r - x[i__5].i * temp.i, z__2.i =
5935
x[i__5].r * temp.i + x[i__5].i * temp.r;
5936
z__1.r = a[i__4].r + z__2.r, z__1.i = a[i__4].i + z__2.i;
5937
a[i__3].r = z__1.r, a[i__3].i = z__1.i;
5948
kx = 1 - (*m - 1) * *incx;
5951
for (j = 1; j <= i__1; ++j) {
5953
if (y[i__2].r != 0. || y[i__2].i != 0.) {
5954
d_cnjg(&z__2, &y[jy]);
5955
z__1.r = alpha->r * z__2.r - alpha->i * z__2.i, z__1.i =
5956
alpha->r * z__2.i + alpha->i * z__2.r;
5957
temp.r = z__1.r, temp.i = z__1.i;
5960
for (i__ = 1; i__ <= i__2; ++i__) {
5961
i__3 = i__ + j * a_dim1;
5962
i__4 = i__ + j * a_dim1;
5964
z__2.r = x[i__5].r * temp.r - x[i__5].i * temp.i, z__2.i =
5965
x[i__5].r * temp.i + x[i__5].i * temp.r;
5966
z__1.r = a[i__4].r + z__2.r, z__1.i = a[i__4].i + z__2.i;
5967
a[i__3].r = z__1.r, a[i__3].i = z__1.i;
5979
/* End of ZGERC . */
5983
/* Subroutine */ int zgeru_(integer *m, integer *n, doublecomplex *alpha,
5984
doublecomplex *x, integer *incx, doublecomplex *y, integer *incy,
5985
doublecomplex *a, integer *lda)
5987
/* System generated locals */
5988
integer a_dim1, a_offset, i__1, i__2, i__3, i__4, i__5;
5989
doublecomplex z__1, z__2;
5991
/* Local variables */
5992
static integer i__, j, ix, jy, kx, info;
5993
static doublecomplex temp;
5994
extern /* Subroutine */ int xerbla_(char *, integer *);
6001
ZGERU performs the rank 1 operation
6003
A := alpha*x*y' + A,
6005
where alpha is a scalar, x is an m element vector, y is an n element
6006
vector and A is an m by n matrix.
6012
On entry, M specifies the number of rows of the matrix A.
6013
M must be at least zero.
6017
On entry, N specifies the number of columns of the matrix A.
6018
N must be at least zero.
6021
ALPHA - COMPLEX*16 .
6022
On entry, ALPHA specifies the scalar alpha.
6025
X - COMPLEX*16 array of dimension at least
6026
( 1 + ( m - 1 )*abs( INCX ) ).
6027
Before entry, the incremented array X must contain the m
6032
On entry, INCX specifies the increment for the elements of
6033
X. INCX must not be zero.
6036
Y - COMPLEX*16 array of dimension at least
6037
( 1 + ( n - 1 )*abs( INCY ) ).
6038
Before entry, the incremented array Y must contain the n
6043
On entry, INCY specifies the increment for the elements of
6044
Y. INCY must not be zero.
6047
A - COMPLEX*16 array of DIMENSION ( LDA, n ).
6048
Before entry, the leading m by n part of the array A must
6049
contain the matrix of coefficients. On exit, A is
6050
overwritten by the updated matrix.
6053
On entry, LDA specifies the first dimension of A as declared
6054
in the calling (sub) program. LDA must be at least
6059
Level 2 Blas routine.
6061
-- Written on 22-October-1986.
6062
Jack Dongarra, Argonne National Lab.
6063
Jeremy Du Croz, Nag Central Office.
6064
Sven Hammarling, Nag Central Office.
6065
Richard Hanson, Sandia National Labs.
6068
Test the input parameters.
6071
/* Parameter adjustments */
6075
a_offset = 1 + a_dim1 * 1;
6082
} else if (*n < 0) {
6084
} else if (*incx == 0) {
6086
} else if (*incy == 0) {
6088
} else if (*lda < max(1,*m)) {
6092
xerbla_("ZGERU ", &info);
6096
/* Quick return if possible. */
6098
if (*m == 0 || *n == 0 || (alpha->r == 0. && alpha->i == 0.)) {
6103
Start the operations. In this version the elements of A are
6104
accessed sequentially with one pass through A.
6110
jy = 1 - (*n - 1) * *incy;
6114
for (j = 1; j <= i__1; ++j) {
6116
if (y[i__2].r != 0. || y[i__2].i != 0.) {
6118
z__1.r = alpha->r * y[i__2].r - alpha->i * y[i__2].i, z__1.i =
6119
alpha->r * y[i__2].i + alpha->i * y[i__2].r;
6120
temp.r = z__1.r, temp.i = z__1.i;
6122
for (i__ = 1; i__ <= i__2; ++i__) {
6123
i__3 = i__ + j * a_dim1;
6124
i__4 = i__ + j * a_dim1;
6126
z__2.r = x[i__5].r * temp.r - x[i__5].i * temp.i, z__2.i =
6127
x[i__5].r * temp.i + x[i__5].i * temp.r;
6128
z__1.r = a[i__4].r + z__2.r, z__1.i = a[i__4].i + z__2.i;
6129
a[i__3].r = z__1.r, a[i__3].i = z__1.i;
6140
kx = 1 - (*m - 1) * *incx;
6143
for (j = 1; j <= i__1; ++j) {
6145
if (y[i__2].r != 0. || y[i__2].i != 0.) {
6147
z__1.r = alpha->r * y[i__2].r - alpha->i * y[i__2].i, z__1.i =
6148
alpha->r * y[i__2].i + alpha->i * y[i__2].r;
6149
temp.r = z__1.r, temp.i = z__1.i;
6152
for (i__ = 1; i__ <= i__2; ++i__) {
6153
i__3 = i__ + j * a_dim1;
6154
i__4 = i__ + j * a_dim1;
6156
z__2.r = x[i__5].r * temp.r - x[i__5].i * temp.i, z__2.i =
6157
x[i__5].r * temp.i + x[i__5].i * temp.r;
6158
z__1.r = a[i__4].r + z__2.r, z__1.i = a[i__4].i + z__2.i;
6159
a[i__3].r = z__1.r, a[i__3].i = z__1.i;
6171
/* End of ZGERU . */
6175
/* Subroutine */ int zhemv_(char *uplo, integer *n, doublecomplex *alpha,
6176
doublecomplex *a, integer *lda, doublecomplex *x, integer *incx,
6177
doublecomplex *beta, doublecomplex *y, integer *incy)
6179
/* System generated locals */
6180
integer a_dim1, a_offset, i__1, i__2, i__3, i__4, i__5;
6182
doublecomplex z__1, z__2, z__3, z__4;
6184
/* Builtin functions */
6185
void d_cnjg(doublecomplex *, doublecomplex *);
6187
/* Local variables */
6188
static integer i__, j, ix, iy, jx, jy, kx, ky, info;
6189
static doublecomplex temp1, temp2;
6190
extern logical lsame_(char *, char *);
6191
extern /* Subroutine */ int xerbla_(char *, integer *);
6198
ZHEMV performs the matrix-vector operation
6200
y := alpha*A*x + beta*y,
6202
where alpha and beta are scalars, x and y are n element vectors and
6203
A is an n by n hermitian matrix.
6209
On entry, UPLO specifies whether the upper or lower
6210
triangular part of the array A is to be referenced as
6213
UPLO = 'U' or 'u' Only the upper triangular part of A
6214
is to be referenced.
6216
UPLO = 'L' or 'l' Only the lower triangular part of A
6217
is to be referenced.
6222
On entry, N specifies the order of the matrix A.
6223
N must be at least zero.
6226
ALPHA - COMPLEX*16 .
6227
On entry, ALPHA specifies the scalar alpha.
6230
A - COMPLEX*16 array of DIMENSION ( LDA, n ).
6231
Before entry with UPLO = 'U' or 'u', the leading n by n
6232
upper triangular part of the array A must contain the upper
6233
triangular part of the hermitian matrix and the strictly
6234
lower triangular part of A is not referenced.
6235
Before entry with UPLO = 'L' or 'l', the leading n by n
6236
lower triangular part of the array A must contain the lower
6237
triangular part of the hermitian matrix and the strictly
6238
upper triangular part of A is not referenced.
6239
Note that the imaginary parts of the diagonal elements need
6240
not be set and are assumed to be zero.
6244
On entry, LDA specifies the first dimension of A as declared
6245
in the calling (sub) program. LDA must be at least
6249
X - COMPLEX*16 array of dimension at least
6250
( 1 + ( n - 1 )*abs( INCX ) ).
6251
Before entry, the incremented array X must contain the n
6256
On entry, INCX specifies the increment for the elements of
6257
X. INCX must not be zero.
6261
On entry, BETA specifies the scalar beta. When BETA is
6262
supplied as zero then Y need not be set on input.
6265
Y - COMPLEX*16 array of dimension at least
6266
( 1 + ( n - 1 )*abs( INCY ) ).
6267
Before entry, the incremented array Y must contain the n
6268
element vector y. On exit, Y is overwritten by the updated
6272
On entry, INCY specifies the increment for the elements of
6273
Y. INCY must not be zero.
6277
Level 2 Blas routine.
6279
-- Written on 22-October-1986.
6280
Jack Dongarra, Argonne National Lab.
6281
Jeremy Du Croz, Nag Central Office.
6282
Sven Hammarling, Nag Central Office.
6283
Richard Hanson, Sandia National Labs.
6286
Test the input parameters.
6289
/* Parameter adjustments */
6291
a_offset = 1 + a_dim1 * 1;
6298
if ((! lsame_(uplo, "U") && ! lsame_(uplo, "L"))) {
6300
} else if (*n < 0) {
6302
} else if (*lda < max(1,*n)) {
6304
} else if (*incx == 0) {
6306
} else if (*incy == 0) {
6310
xerbla_("ZHEMV ", &info);
6314
/* Quick return if possible. */
6316
if (*n == 0 || ((alpha->r == 0. && alpha->i == 0.) && ((beta->r == 1. &&
6321
/* Set up the start points in X and Y. */
6326
kx = 1 - (*n - 1) * *incx;
6331
ky = 1 - (*n - 1) * *incy;
6335
Start the operations. In this version the elements of A are
6336
accessed sequentially with one pass through the triangular part
6339
First form y := beta*y.
6342
if (beta->r != 1. || beta->i != 0.) {
6344
if ((beta->r == 0. && beta->i == 0.)) {
6346
for (i__ = 1; i__ <= i__1; ++i__) {
6348
y[i__2].r = 0., y[i__2].i = 0.;
6353
for (i__ = 1; i__ <= i__1; ++i__) {
6356
z__1.r = beta->r * y[i__3].r - beta->i * y[i__3].i,
6357
z__1.i = beta->r * y[i__3].i + beta->i * y[i__3]
6359
y[i__2].r = z__1.r, y[i__2].i = z__1.i;
6365
if ((beta->r == 0. && beta->i == 0.)) {
6367
for (i__ = 1; i__ <= i__1; ++i__) {
6369
y[i__2].r = 0., y[i__2].i = 0.;
6375
for (i__ = 1; i__ <= i__1; ++i__) {
6378
z__1.r = beta->r * y[i__3].r - beta->i * y[i__3].i,
6379
z__1.i = beta->r * y[i__3].i + beta->i * y[i__3]
6381
y[i__2].r = z__1.r, y[i__2].i = z__1.i;
6388
if ((alpha->r == 0. && alpha->i == 0.)) {
6391
if (lsame_(uplo, "U")) {
6393
/* Form y when A is stored in upper triangle. */
6395
if ((*incx == 1 && *incy == 1)) {
6397
for (j = 1; j <= i__1; ++j) {
6399
z__1.r = alpha->r * x[i__2].r - alpha->i * x[i__2].i, z__1.i =
6400
alpha->r * x[i__2].i + alpha->i * x[i__2].r;
6401
temp1.r = z__1.r, temp1.i = z__1.i;
6402
temp2.r = 0., temp2.i = 0.;
6404
for (i__ = 1; i__ <= i__2; ++i__) {
6407
i__5 = i__ + j * a_dim1;
6408
z__2.r = temp1.r * a[i__5].r - temp1.i * a[i__5].i,
6409
z__2.i = temp1.r * a[i__5].i + temp1.i * a[i__5]
6411
z__1.r = y[i__4].r + z__2.r, z__1.i = y[i__4].i + z__2.i;
6412
y[i__3].r = z__1.r, y[i__3].i = z__1.i;
6413
d_cnjg(&z__3, &a[i__ + j * a_dim1]);
6415
z__2.r = z__3.r * x[i__3].r - z__3.i * x[i__3].i, z__2.i =
6416
z__3.r * x[i__3].i + z__3.i * x[i__3].r;
6417
z__1.r = temp2.r + z__2.r, z__1.i = temp2.i + z__2.i;
6418
temp2.r = z__1.r, temp2.i = z__1.i;
6423
i__4 = j + j * a_dim1;
6425
z__3.r = d__1 * temp1.r, z__3.i = d__1 * temp1.i;
6426
z__2.r = y[i__3].r + z__3.r, z__2.i = y[i__3].i + z__3.i;
6427
z__4.r = alpha->r * temp2.r - alpha->i * temp2.i, z__4.i =
6428
alpha->r * temp2.i + alpha->i * temp2.r;
6429
z__1.r = z__2.r + z__4.r, z__1.i = z__2.i + z__4.i;
6430
y[i__2].r = z__1.r, y[i__2].i = z__1.i;
6437
for (j = 1; j <= i__1; ++j) {
6439
z__1.r = alpha->r * x[i__2].r - alpha->i * x[i__2].i, z__1.i =
6440
alpha->r * x[i__2].i + alpha->i * x[i__2].r;
6441
temp1.r = z__1.r, temp1.i = z__1.i;
6442
temp2.r = 0., temp2.i = 0.;
6446
for (i__ = 1; i__ <= i__2; ++i__) {
6449
i__5 = i__ + j * a_dim1;
6450
z__2.r = temp1.r * a[i__5].r - temp1.i * a[i__5].i,
6451
z__2.i = temp1.r * a[i__5].i + temp1.i * a[i__5]
6453
z__1.r = y[i__4].r + z__2.r, z__1.i = y[i__4].i + z__2.i;
6454
y[i__3].r = z__1.r, y[i__3].i = z__1.i;
6455
d_cnjg(&z__3, &a[i__ + j * a_dim1]);
6457
z__2.r = z__3.r * x[i__3].r - z__3.i * x[i__3].i, z__2.i =
6458
z__3.r * x[i__3].i + z__3.i * x[i__3].r;
6459
z__1.r = temp2.r + z__2.r, z__1.i = temp2.i + z__2.i;
6460
temp2.r = z__1.r, temp2.i = z__1.i;
6467
i__4 = j + j * a_dim1;
6469
z__3.r = d__1 * temp1.r, z__3.i = d__1 * temp1.i;
6470
z__2.r = y[i__3].r + z__3.r, z__2.i = y[i__3].i + z__3.i;
6471
z__4.r = alpha->r * temp2.r - alpha->i * temp2.i, z__4.i =
6472
alpha->r * temp2.i + alpha->i * temp2.r;
6473
z__1.r = z__2.r + z__4.r, z__1.i = z__2.i + z__4.i;
6474
y[i__2].r = z__1.r, y[i__2].i = z__1.i;
6482
/* Form y when A is stored in lower triangle. */
6484
if ((*incx == 1 && *incy == 1)) {
6486
for (j = 1; j <= i__1; ++j) {
6488
z__1.r = alpha->r * x[i__2].r - alpha->i * x[i__2].i, z__1.i =
6489
alpha->r * x[i__2].i + alpha->i * x[i__2].r;
6490
temp1.r = z__1.r, temp1.i = z__1.i;
6491
temp2.r = 0., temp2.i = 0.;
6494
i__4 = j + j * a_dim1;
6496
z__2.r = d__1 * temp1.r, z__2.i = d__1 * temp1.i;
6497
z__1.r = y[i__3].r + z__2.r, z__1.i = y[i__3].i + z__2.i;
6498
y[i__2].r = z__1.r, y[i__2].i = z__1.i;
6500
for (i__ = j + 1; i__ <= i__2; ++i__) {
6503
i__5 = i__ + j * a_dim1;
6504
z__2.r = temp1.r * a[i__5].r - temp1.i * a[i__5].i,
6505
z__2.i = temp1.r * a[i__5].i + temp1.i * a[i__5]
6507
z__1.r = y[i__4].r + z__2.r, z__1.i = y[i__4].i + z__2.i;
6508
y[i__3].r = z__1.r, y[i__3].i = z__1.i;
6509
d_cnjg(&z__3, &a[i__ + j * a_dim1]);
6511
z__2.r = z__3.r * x[i__3].r - z__3.i * x[i__3].i, z__2.i =
6512
z__3.r * x[i__3].i + z__3.i * x[i__3].r;
6513
z__1.r = temp2.r + z__2.r, z__1.i = temp2.i + z__2.i;
6514
temp2.r = z__1.r, temp2.i = z__1.i;
6519
z__2.r = alpha->r * temp2.r - alpha->i * temp2.i, z__2.i =
6520
alpha->r * temp2.i + alpha->i * temp2.r;
6521
z__1.r = y[i__3].r + z__2.r, z__1.i = y[i__3].i + z__2.i;
6522
y[i__2].r = z__1.r, y[i__2].i = z__1.i;
6529
for (j = 1; j <= i__1; ++j) {
6531
z__1.r = alpha->r * x[i__2].r - alpha->i * x[i__2].i, z__1.i =
6532
alpha->r * x[i__2].i + alpha->i * x[i__2].r;
6533
temp1.r = z__1.r, temp1.i = z__1.i;
6534
temp2.r = 0., temp2.i = 0.;
6537
i__4 = j + j * a_dim1;
6539
z__2.r = d__1 * temp1.r, z__2.i = d__1 * temp1.i;
6540
z__1.r = y[i__3].r + z__2.r, z__1.i = y[i__3].i + z__2.i;
6541
y[i__2].r = z__1.r, y[i__2].i = z__1.i;
6545
for (i__ = j + 1; i__ <= i__2; ++i__) {
6550
i__5 = i__ + j * a_dim1;
6551
z__2.r = temp1.r * a[i__5].r - temp1.i * a[i__5].i,
6552
z__2.i = temp1.r * a[i__5].i + temp1.i * a[i__5]
6554
z__1.r = y[i__4].r + z__2.r, z__1.i = y[i__4].i + z__2.i;
6555
y[i__3].r = z__1.r, y[i__3].i = z__1.i;
6556
d_cnjg(&z__3, &a[i__ + j * a_dim1]);
6558
z__2.r = z__3.r * x[i__3].r - z__3.i * x[i__3].i, z__2.i =
6559
z__3.r * x[i__3].i + z__3.i * x[i__3].r;
6560
z__1.r = temp2.r + z__2.r, z__1.i = temp2.i + z__2.i;
6561
temp2.r = z__1.r, temp2.i = z__1.i;
6566
z__2.r = alpha->r * temp2.r - alpha->i * temp2.i, z__2.i =
6567
alpha->r * temp2.i + alpha->i * temp2.r;
6568
z__1.r = y[i__3].r + z__2.r, z__1.i = y[i__3].i + z__2.i;
6569
y[i__2].r = z__1.r, y[i__2].i = z__1.i;
6579
/* End of ZHEMV . */
6583
/* Subroutine */ int zher2_(char *uplo, integer *n, doublecomplex *alpha,
6584
doublecomplex *x, integer *incx, doublecomplex *y, integer *incy,
6585
doublecomplex *a, integer *lda)
6587
/* System generated locals */
6588
integer a_dim1, a_offset, i__1, i__2, i__3, i__4, i__5, i__6;
6590
doublecomplex z__1, z__2, z__3, z__4;
6592
/* Builtin functions */
6593
void d_cnjg(doublecomplex *, doublecomplex *);
6595
/* Local variables */
6596
static integer i__, j, ix, iy, jx, jy, kx, ky, info;
6597
static doublecomplex temp1, temp2;
6598
extern logical lsame_(char *, char *);
6599
extern /* Subroutine */ int xerbla_(char *, integer *);
6606
ZHER2 performs the hermitian rank 2 operation
6608
A := alpha*x*conjg( y' ) + conjg( alpha )*y*conjg( x' ) + A,
6610
where alpha is a scalar, x and y are n element vectors and A is an n
6611
by n hermitian matrix.
6617
On entry, UPLO specifies whether the upper or lower
6618
triangular part of the array A is to be referenced as
6621
UPLO = 'U' or 'u' Only the upper triangular part of A
6622
is to be referenced.
6624
UPLO = 'L' or 'l' Only the lower triangular part of A
6625
is to be referenced.
6630
On entry, N specifies the order of the matrix A.
6631
N must be at least zero.
6634
ALPHA - COMPLEX*16 .
6635
On entry, ALPHA specifies the scalar alpha.
6638
X - COMPLEX*16 array of dimension at least
6639
( 1 + ( n - 1 )*abs( INCX ) ).
6640
Before entry, the incremented array X must contain the n
6645
On entry, INCX specifies the increment for the elements of
6646
X. INCX must not be zero.
6649
Y - COMPLEX*16 array of dimension at least
6650
( 1 + ( n - 1 )*abs( INCY ) ).
6651
Before entry, the incremented array Y must contain the n
6656
On entry, INCY specifies the increment for the elements of
6657
Y. INCY must not be zero.
6660
A - COMPLEX*16 array of DIMENSION ( LDA, n ).
6661
Before entry with UPLO = 'U' or 'u', the leading n by n
6662
upper triangular part of the array A must contain the upper
6663
triangular part of the hermitian matrix and the strictly
6664
lower triangular part of A is not referenced. On exit, the
6665
upper triangular part of the array A is overwritten by the
6666
upper triangular part of the updated matrix.
6667
Before entry with UPLO = 'L' or 'l', the leading n by n
6668
lower triangular part of the array A must contain the lower
6669
triangular part of the hermitian matrix and the strictly
6670
upper triangular part of A is not referenced. On exit, the
6671
lower triangular part of the array A is overwritten by the
6672
lower triangular part of the updated matrix.
6673
Note that the imaginary parts of the diagonal elements need
6674
not be set, they are assumed to be zero, and on exit they
6678
On entry, LDA specifies the first dimension of A as declared
6679
in the calling (sub) program. LDA must be at least
6684
Level 2 Blas routine.
6686
-- Written on 22-October-1986.
6687
Jack Dongarra, Argonne National Lab.
6688
Jeremy Du Croz, Nag Central Office.
6689
Sven Hammarling, Nag Central Office.
6690
Richard Hanson, Sandia National Labs.
6693
Test the input parameters.
6696
/* Parameter adjustments */
6700
a_offset = 1 + a_dim1 * 1;
6705
if ((! lsame_(uplo, "U") && ! lsame_(uplo, "L"))) {
6707
} else if (*n < 0) {
6709
} else if (*incx == 0) {
6711
} else if (*incy == 0) {
6713
} else if (*lda < max(1,*n)) {
6717
xerbla_("ZHER2 ", &info);
6721
/* Quick return if possible. */
6723
if (*n == 0 || (alpha->r == 0. && alpha->i == 0.)) {
6728
Set up the start points in X and Y if the increments are not both
6732
if (*incx != 1 || *incy != 1) {
6736
kx = 1 - (*n - 1) * *incx;
6741
ky = 1 - (*n - 1) * *incy;
6748
Start the operations. In this version the elements of A are
6749
accessed sequentially with one pass through the triangular part
6753
if (lsame_(uplo, "U")) {
6755
/* Form A when A is stored in the upper triangle. */
6757
if ((*incx == 1 && *incy == 1)) {
6759
for (j = 1; j <= i__1; ++j) {
6762
if (x[i__2].r != 0. || x[i__2].i != 0. || (y[i__3].r != 0. ||
6764
d_cnjg(&z__2, &y[j]);
6765
z__1.r = alpha->r * z__2.r - alpha->i * z__2.i, z__1.i =
6766
alpha->r * z__2.i + alpha->i * z__2.r;
6767
temp1.r = z__1.r, temp1.i = z__1.i;
6769
z__2.r = alpha->r * x[i__2].r - alpha->i * x[i__2].i,
6770
z__2.i = alpha->r * x[i__2].i + alpha->i * x[i__2]
6772
d_cnjg(&z__1, &z__2);
6773
temp2.r = z__1.r, temp2.i = z__1.i;
6775
for (i__ = 1; i__ <= i__2; ++i__) {
6776
i__3 = i__ + j * a_dim1;
6777
i__4 = i__ + j * a_dim1;
6779
z__3.r = x[i__5].r * temp1.r - x[i__5].i * temp1.i,
6780
z__3.i = x[i__5].r * temp1.i + x[i__5].i *
6782
z__2.r = a[i__4].r + z__3.r, z__2.i = a[i__4].i +
6785
z__4.r = y[i__6].r * temp2.r - y[i__6].i * temp2.i,
6786
z__4.i = y[i__6].r * temp2.i + y[i__6].i *
6788
z__1.r = z__2.r + z__4.r, z__1.i = z__2.i + z__4.i;
6789
a[i__3].r = z__1.r, a[i__3].i = z__1.i;
6792
i__2 = j + j * a_dim1;
6793
i__3 = j + j * a_dim1;
6795
z__2.r = x[i__4].r * temp1.r - x[i__4].i * temp1.i,
6796
z__2.i = x[i__4].r * temp1.i + x[i__4].i *
6799
z__3.r = y[i__5].r * temp2.r - y[i__5].i * temp2.i,
6800
z__3.i = y[i__5].r * temp2.i + y[i__5].i *
6802
z__1.r = z__2.r + z__3.r, z__1.i = z__2.i + z__3.i;
6803
d__1 = a[i__3].r + z__1.r;
6804
a[i__2].r = d__1, a[i__2].i = 0.;
6806
i__2 = j + j * a_dim1;
6807
i__3 = j + j * a_dim1;
6809
a[i__2].r = d__1, a[i__2].i = 0.;
6815
for (j = 1; j <= i__1; ++j) {
6818
if (x[i__2].r != 0. || x[i__2].i != 0. || (y[i__3].r != 0. ||
6820
d_cnjg(&z__2, &y[jy]);
6821
z__1.r = alpha->r * z__2.r - alpha->i * z__2.i, z__1.i =
6822
alpha->r * z__2.i + alpha->i * z__2.r;
6823
temp1.r = z__1.r, temp1.i = z__1.i;
6825
z__2.r = alpha->r * x[i__2].r - alpha->i * x[i__2].i,
6826
z__2.i = alpha->r * x[i__2].i + alpha->i * x[i__2]
6828
d_cnjg(&z__1, &z__2);
6829
temp2.r = z__1.r, temp2.i = z__1.i;
6833
for (i__ = 1; i__ <= i__2; ++i__) {
6834
i__3 = i__ + j * a_dim1;
6835
i__4 = i__ + j * a_dim1;
6837
z__3.r = x[i__5].r * temp1.r - x[i__5].i * temp1.i,
6838
z__3.i = x[i__5].r * temp1.i + x[i__5].i *
6840
z__2.r = a[i__4].r + z__3.r, z__2.i = a[i__4].i +
6843
z__4.r = y[i__6].r * temp2.r - y[i__6].i * temp2.i,
6844
z__4.i = y[i__6].r * temp2.i + y[i__6].i *
6846
z__1.r = z__2.r + z__4.r, z__1.i = z__2.i + z__4.i;
6847
a[i__3].r = z__1.r, a[i__3].i = z__1.i;
6852
i__2 = j + j * a_dim1;
6853
i__3 = j + j * a_dim1;
6855
z__2.r = x[i__4].r * temp1.r - x[i__4].i * temp1.i,
6856
z__2.i = x[i__4].r * temp1.i + x[i__4].i *
6859
z__3.r = y[i__5].r * temp2.r - y[i__5].i * temp2.i,
6860
z__3.i = y[i__5].r * temp2.i + y[i__5].i *
6862
z__1.r = z__2.r + z__3.r, z__1.i = z__2.i + z__3.i;
6863
d__1 = a[i__3].r + z__1.r;
6864
a[i__2].r = d__1, a[i__2].i = 0.;
6866
i__2 = j + j * a_dim1;
6867
i__3 = j + j * a_dim1;
6869
a[i__2].r = d__1, a[i__2].i = 0.;
6878
/* Form A when A is stored in the lower triangle. */
6880
if ((*incx == 1 && *incy == 1)) {
6882
for (j = 1; j <= i__1; ++j) {
6885
if (x[i__2].r != 0. || x[i__2].i != 0. || (y[i__3].r != 0. ||
6887
d_cnjg(&z__2, &y[j]);
6888
z__1.r = alpha->r * z__2.r - alpha->i * z__2.i, z__1.i =
6889
alpha->r * z__2.i + alpha->i * z__2.r;
6890
temp1.r = z__1.r, temp1.i = z__1.i;
6892
z__2.r = alpha->r * x[i__2].r - alpha->i * x[i__2].i,
6893
z__2.i = alpha->r * x[i__2].i + alpha->i * x[i__2]
6895
d_cnjg(&z__1, &z__2);
6896
temp2.r = z__1.r, temp2.i = z__1.i;
6897
i__2 = j + j * a_dim1;
6898
i__3 = j + j * a_dim1;
6900
z__2.r = x[i__4].r * temp1.r - x[i__4].i * temp1.i,
6901
z__2.i = x[i__4].r * temp1.i + x[i__4].i *
6904
z__3.r = y[i__5].r * temp2.r - y[i__5].i * temp2.i,
6905
z__3.i = y[i__5].r * temp2.i + y[i__5].i *
6907
z__1.r = z__2.r + z__3.r, z__1.i = z__2.i + z__3.i;
6908
d__1 = a[i__3].r + z__1.r;
6909
a[i__2].r = d__1, a[i__2].i = 0.;
6911
for (i__ = j + 1; i__ <= i__2; ++i__) {
6912
i__3 = i__ + j * a_dim1;
6913
i__4 = i__ + j * a_dim1;
6915
z__3.r = x[i__5].r * temp1.r - x[i__5].i * temp1.i,
6916
z__3.i = x[i__5].r * temp1.i + x[i__5].i *
6918
z__2.r = a[i__4].r + z__3.r, z__2.i = a[i__4].i +
6921
z__4.r = y[i__6].r * temp2.r - y[i__6].i * temp2.i,
6922
z__4.i = y[i__6].r * temp2.i + y[i__6].i *
6924
z__1.r = z__2.r + z__4.r, z__1.i = z__2.i + z__4.i;
6925
a[i__3].r = z__1.r, a[i__3].i = z__1.i;
6929
i__2 = j + j * a_dim1;
6930
i__3 = j + j * a_dim1;
6932
a[i__2].r = d__1, a[i__2].i = 0.;
6938
for (j = 1; j <= i__1; ++j) {
6941
if (x[i__2].r != 0. || x[i__2].i != 0. || (y[i__3].r != 0. ||
6943
d_cnjg(&z__2, &y[jy]);
6944
z__1.r = alpha->r * z__2.r - alpha->i * z__2.i, z__1.i =
6945
alpha->r * z__2.i + alpha->i * z__2.r;
6946
temp1.r = z__1.r, temp1.i = z__1.i;
6948
z__2.r = alpha->r * x[i__2].r - alpha->i * x[i__2].i,
6949
z__2.i = alpha->r * x[i__2].i + alpha->i * x[i__2]
6951
d_cnjg(&z__1, &z__2);
6952
temp2.r = z__1.r, temp2.i = z__1.i;
6953
i__2 = j + j * a_dim1;
6954
i__3 = j + j * a_dim1;
6956
z__2.r = x[i__4].r * temp1.r - x[i__4].i * temp1.i,
6957
z__2.i = x[i__4].r * temp1.i + x[i__4].i *
6960
z__3.r = y[i__5].r * temp2.r - y[i__5].i * temp2.i,
6961
z__3.i = y[i__5].r * temp2.i + y[i__5].i *
6963
z__1.r = z__2.r + z__3.r, z__1.i = z__2.i + z__3.i;
6964
d__1 = a[i__3].r + z__1.r;
6965
a[i__2].r = d__1, a[i__2].i = 0.;
6969
for (i__ = j + 1; i__ <= i__2; ++i__) {
6972
i__3 = i__ + j * a_dim1;
6973
i__4 = i__ + j * a_dim1;
6975
z__3.r = x[i__5].r * temp1.r - x[i__5].i * temp1.i,
6976
z__3.i = x[i__5].r * temp1.i + x[i__5].i *
6978
z__2.r = a[i__4].r + z__3.r, z__2.i = a[i__4].i +
6981
z__4.r = y[i__6].r * temp2.r - y[i__6].i * temp2.i,
6982
z__4.i = y[i__6].r * temp2.i + y[i__6].i *
6984
z__1.r = z__2.r + z__4.r, z__1.i = z__2.i + z__4.i;
6985
a[i__3].r = z__1.r, a[i__3].i = z__1.i;
6989
i__2 = j + j * a_dim1;
6990
i__3 = j + j * a_dim1;
6992
a[i__2].r = d__1, a[i__2].i = 0.;
7003
/* End of ZHER2 . */
7007
/* Subroutine */ int zher2k_(char *uplo, char *trans, integer *n, integer *k,
7008
doublecomplex *alpha, doublecomplex *a, integer *lda, doublecomplex *
7009
b, integer *ldb, doublereal *beta, doublecomplex *c__, integer *ldc)
7011
/* System generated locals */
7012
integer a_dim1, a_offset, b_dim1, b_offset, c_dim1, c_offset, i__1, i__2,
7013
i__3, i__4, i__5, i__6, i__7;
7015
doublecomplex z__1, z__2, z__3, z__4, z__5, z__6;
7017
/* Builtin functions */
7018
void d_cnjg(doublecomplex *, doublecomplex *);
7020
/* Local variables */
7021
static integer i__, j, l, info;
7022
static doublecomplex temp1, temp2;
7023
extern logical lsame_(char *, char *);
7024
static integer nrowa;
7025
static logical upper;
7026
extern /* Subroutine */ int xerbla_(char *, integer *);
7033
ZHER2K performs one of the hermitian rank 2k operations
7035
C := alpha*A*conjg( B' ) + conjg( alpha )*B*conjg( A' ) + beta*C,
7039
C := alpha*conjg( A' )*B + conjg( alpha )*conjg( B' )*A + beta*C,
7041
where alpha and beta are scalars with beta real, C is an n by n
7042
hermitian matrix and A and B are n by k matrices in the first case
7043
and k by n matrices in the second case.
7049
On entry, UPLO specifies whether the upper or lower
7050
triangular part of the array C is to be referenced as
7053
UPLO = 'U' or 'u' Only the upper triangular part of C
7054
is to be referenced.
7056
UPLO = 'L' or 'l' Only the lower triangular part of C
7057
is to be referenced.
7061
TRANS - CHARACTER*1.
7062
On entry, TRANS specifies the operation to be performed as
7065
TRANS = 'N' or 'n' C := alpha*A*conjg( B' ) +
7066
conjg( alpha )*B*conjg( A' ) +
7069
TRANS = 'C' or 'c' C := alpha*conjg( A' )*B +
7070
conjg( alpha )*conjg( B' )*A +
7076
On entry, N specifies the order of the matrix C. N must be
7081
On entry with TRANS = 'N' or 'n', K specifies the number
7082
of columns of the matrices A and B, and on entry with
7083
TRANS = 'C' or 'c', K specifies the number of rows of the
7084
matrices A and B. K must be at least zero.
7087
ALPHA - COMPLEX*16 .
7088
On entry, ALPHA specifies the scalar alpha.
7091
A - COMPLEX*16 array of DIMENSION ( LDA, ka ), where ka is
7092
k when TRANS = 'N' or 'n', and is n otherwise.
7093
Before entry with TRANS = 'N' or 'n', the leading n by k
7094
part of the array A must contain the matrix A, otherwise
7095
the leading k by n part of the array A must contain the
7100
On entry, LDA specifies the first dimension of A as declared
7101
in the calling (sub) program. When TRANS = 'N' or 'n'
7102
then LDA must be at least max( 1, n ), otherwise LDA must
7103
be at least max( 1, k ).
7106
B - COMPLEX*16 array of DIMENSION ( LDB, kb ), where kb is
7107
k when TRANS = 'N' or 'n', and is n otherwise.
7108
Before entry with TRANS = 'N' or 'n', the leading n by k
7109
part of the array B must contain the matrix B, otherwise
7110
the leading k by n part of the array B must contain the
7115
On entry, LDB specifies the first dimension of B as declared
7116
in the calling (sub) program. When TRANS = 'N' or 'n'
7117
then LDB must be at least max( 1, n ), otherwise LDB must
7118
be at least max( 1, k ).
7121
BETA - DOUBLE PRECISION .
7122
On entry, BETA specifies the scalar beta.
7125
C - COMPLEX*16 array of DIMENSION ( LDC, n ).
7126
Before entry with UPLO = 'U' or 'u', the leading n by n
7127
upper triangular part of the array C must contain the upper
7128
triangular part of the hermitian matrix and the strictly
7129
lower triangular part of C is not referenced. On exit, the
7130
upper triangular part of the array C is overwritten by the
7131
upper triangular part of the updated matrix.
7132
Before entry with UPLO = 'L' or 'l', the leading n by n
7133
lower triangular part of the array C must contain the lower
7134
triangular part of the hermitian matrix and the strictly
7135
upper triangular part of C is not referenced. On exit, the
7136
lower triangular part of the array C is overwritten by the
7137
lower triangular part of the updated matrix.
7138
Note that the imaginary parts of the diagonal elements need
7139
not be set, they are assumed to be zero, and on exit they
7143
On entry, LDC specifies the first dimension of C as declared
7144
in the calling (sub) program. LDC must be at least
7149
Level 3 Blas routine.
7151
-- Written on 8-February-1989.
7152
Jack Dongarra, Argonne National Laboratory.
7153
Iain Duff, AERE Harwell.
7154
Jeremy Du Croz, Numerical Algorithms Group Ltd.
7155
Sven Hammarling, Numerical Algorithms Group Ltd.
7157
-- Modified 8-Nov-93 to set C(J,J) to DBLE( C(J,J) ) when BETA = 1.
7158
Ed Anderson, Cray Research Inc.
7161
Test the input parameters.
7164
/* Parameter adjustments */
7166
a_offset = 1 + a_dim1 * 1;
7169
b_offset = 1 + b_dim1 * 1;
7172
c_offset = 1 + c_dim1 * 1;
7176
if (lsame_(trans, "N")) {
7181
upper = lsame_(uplo, "U");
7184
if ((! upper && ! lsame_(uplo, "L"))) {
7186
} else if ((! lsame_(trans, "N") && ! lsame_(trans,
7189
} else if (*n < 0) {
7191
} else if (*k < 0) {
7193
} else if (*lda < max(1,nrowa)) {
7195
} else if (*ldb < max(1,nrowa)) {
7197
} else if (*ldc < max(1,*n)) {
7201
xerbla_("ZHER2K", &info);
7205
/* Quick return if possible. */
7207
if (*n == 0 || (((alpha->r == 0. && alpha->i == 0.) || *k == 0) && *beta
7212
/* And when alpha.eq.zero. */
7214
if ((alpha->r == 0. && alpha->i == 0.)) {
7218
for (j = 1; j <= i__1; ++j) {
7220
for (i__ = 1; i__ <= i__2; ++i__) {
7221
i__3 = i__ + j * c_dim1;
7222
c__[i__3].r = 0., c__[i__3].i = 0.;
7229
for (j = 1; j <= i__1; ++j) {
7231
for (i__ = 1; i__ <= i__2; ++i__) {
7232
i__3 = i__ + j * c_dim1;
7233
i__4 = i__ + j * c_dim1;
7234
z__1.r = *beta * c__[i__4].r, z__1.i = *beta * c__[
7236
c__[i__3].r = z__1.r, c__[i__3].i = z__1.i;
7239
i__2 = j + j * c_dim1;
7240
i__3 = j + j * c_dim1;
7241
d__1 = *beta * c__[i__3].r;
7242
c__[i__2].r = d__1, c__[i__2].i = 0.;
7249
for (j = 1; j <= i__1; ++j) {
7251
for (i__ = j; i__ <= i__2; ++i__) {
7252
i__3 = i__ + j * c_dim1;
7253
c__[i__3].r = 0., c__[i__3].i = 0.;
7260
for (j = 1; j <= i__1; ++j) {
7261
i__2 = j + j * c_dim1;
7262
i__3 = j + j * c_dim1;
7263
d__1 = *beta * c__[i__3].r;
7264
c__[i__2].r = d__1, c__[i__2].i = 0.;
7266
for (i__ = j + 1; i__ <= i__2; ++i__) {
7267
i__3 = i__ + j * c_dim1;
7268
i__4 = i__ + j * c_dim1;
7269
z__1.r = *beta * c__[i__4].r, z__1.i = *beta * c__[
7271
c__[i__3].r = z__1.r, c__[i__3].i = z__1.i;
7281
/* Start the operations. */
7283
if (lsame_(trans, "N")) {
7286
Form C := alpha*A*conjg( B' ) + conjg( alpha )*B*conjg( A' ) +
7292
for (j = 1; j <= i__1; ++j) {
7295
for (i__ = 1; i__ <= i__2; ++i__) {
7296
i__3 = i__ + j * c_dim1;
7297
c__[i__3].r = 0., c__[i__3].i = 0.;
7300
} else if (*beta != 1.) {
7302
for (i__ = 1; i__ <= i__2; ++i__) {
7303
i__3 = i__ + j * c_dim1;
7304
i__4 = i__ + j * c_dim1;
7305
z__1.r = *beta * c__[i__4].r, z__1.i = *beta * c__[
7307
c__[i__3].r = z__1.r, c__[i__3].i = z__1.i;
7310
i__2 = j + j * c_dim1;
7311
i__3 = j + j * c_dim1;
7312
d__1 = *beta * c__[i__3].r;
7313
c__[i__2].r = d__1, c__[i__2].i = 0.;
7315
i__2 = j + j * c_dim1;
7316
i__3 = j + j * c_dim1;
7318
c__[i__2].r = d__1, c__[i__2].i = 0.;
7321
for (l = 1; l <= i__2; ++l) {
7322
i__3 = j + l * a_dim1;
7323
i__4 = j + l * b_dim1;
7324
if (a[i__3].r != 0. || a[i__3].i != 0. || (b[i__4].r !=
7325
0. || b[i__4].i != 0.)) {
7326
d_cnjg(&z__2, &b[j + l * b_dim1]);
7327
z__1.r = alpha->r * z__2.r - alpha->i * z__2.i,
7328
z__1.i = alpha->r * z__2.i + alpha->i *
7330
temp1.r = z__1.r, temp1.i = z__1.i;
7331
i__3 = j + l * a_dim1;
7332
z__2.r = alpha->r * a[i__3].r - alpha->i * a[i__3].i,
7333
z__2.i = alpha->r * a[i__3].i + alpha->i * a[
7335
d_cnjg(&z__1, &z__2);
7336
temp2.r = z__1.r, temp2.i = z__1.i;
7338
for (i__ = 1; i__ <= i__3; ++i__) {
7339
i__4 = i__ + j * c_dim1;
7340
i__5 = i__ + j * c_dim1;
7341
i__6 = i__ + l * a_dim1;
7342
z__3.r = a[i__6].r * temp1.r - a[i__6].i *
7343
temp1.i, z__3.i = a[i__6].r * temp1.i + a[
7345
z__2.r = c__[i__5].r + z__3.r, z__2.i = c__[i__5]
7347
i__7 = i__ + l * b_dim1;
7348
z__4.r = b[i__7].r * temp2.r - b[i__7].i *
7349
temp2.i, z__4.i = b[i__7].r * temp2.i + b[
7351
z__1.r = z__2.r + z__4.r, z__1.i = z__2.i +
7353
c__[i__4].r = z__1.r, c__[i__4].i = z__1.i;
7356
i__3 = j + j * c_dim1;
7357
i__4 = j + j * c_dim1;
7358
i__5 = j + l * a_dim1;
7359
z__2.r = a[i__5].r * temp1.r - a[i__5].i * temp1.i,
7360
z__2.i = a[i__5].r * temp1.i + a[i__5].i *
7362
i__6 = j + l * b_dim1;
7363
z__3.r = b[i__6].r * temp2.r - b[i__6].i * temp2.i,
7364
z__3.i = b[i__6].r * temp2.i + b[i__6].i *
7366
z__1.r = z__2.r + z__3.r, z__1.i = z__2.i + z__3.i;
7367
d__1 = c__[i__4].r + z__1.r;
7368
c__[i__3].r = d__1, c__[i__3].i = 0.;
7376
for (j = 1; j <= i__1; ++j) {
7379
for (i__ = j; i__ <= i__2; ++i__) {
7380
i__3 = i__ + j * c_dim1;
7381
c__[i__3].r = 0., c__[i__3].i = 0.;
7384
} else if (*beta != 1.) {
7386
for (i__ = j + 1; i__ <= i__2; ++i__) {
7387
i__3 = i__ + j * c_dim1;
7388
i__4 = i__ + j * c_dim1;
7389
z__1.r = *beta * c__[i__4].r, z__1.i = *beta * c__[
7391
c__[i__3].r = z__1.r, c__[i__3].i = z__1.i;
7394
i__2 = j + j * c_dim1;
7395
i__3 = j + j * c_dim1;
7396
d__1 = *beta * c__[i__3].r;
7397
c__[i__2].r = d__1, c__[i__2].i = 0.;
7399
i__2 = j + j * c_dim1;
7400
i__3 = j + j * c_dim1;
7402
c__[i__2].r = d__1, c__[i__2].i = 0.;
7405
for (l = 1; l <= i__2; ++l) {
7406
i__3 = j + l * a_dim1;
7407
i__4 = j + l * b_dim1;
7408
if (a[i__3].r != 0. || a[i__3].i != 0. || (b[i__4].r !=
7409
0. || b[i__4].i != 0.)) {
7410
d_cnjg(&z__2, &b[j + l * b_dim1]);
7411
z__1.r = alpha->r * z__2.r - alpha->i * z__2.i,
7412
z__1.i = alpha->r * z__2.i + alpha->i *
7414
temp1.r = z__1.r, temp1.i = z__1.i;
7415
i__3 = j + l * a_dim1;
7416
z__2.r = alpha->r * a[i__3].r - alpha->i * a[i__3].i,
7417
z__2.i = alpha->r * a[i__3].i + alpha->i * a[
7419
d_cnjg(&z__1, &z__2);
7420
temp2.r = z__1.r, temp2.i = z__1.i;
7422
for (i__ = j + 1; i__ <= i__3; ++i__) {
7423
i__4 = i__ + j * c_dim1;
7424
i__5 = i__ + j * c_dim1;
7425
i__6 = i__ + l * a_dim1;
7426
z__3.r = a[i__6].r * temp1.r - a[i__6].i *
7427
temp1.i, z__3.i = a[i__6].r * temp1.i + a[
7429
z__2.r = c__[i__5].r + z__3.r, z__2.i = c__[i__5]
7431
i__7 = i__ + l * b_dim1;
7432
z__4.r = b[i__7].r * temp2.r - b[i__7].i *
7433
temp2.i, z__4.i = b[i__7].r * temp2.i + b[
7435
z__1.r = z__2.r + z__4.r, z__1.i = z__2.i +
7437
c__[i__4].r = z__1.r, c__[i__4].i = z__1.i;
7440
i__3 = j + j * c_dim1;
7441
i__4 = j + j * c_dim1;
7442
i__5 = j + l * a_dim1;
7443
z__2.r = a[i__5].r * temp1.r - a[i__5].i * temp1.i,
7444
z__2.i = a[i__5].r * temp1.i + a[i__5].i *
7446
i__6 = j + l * b_dim1;
7447
z__3.r = b[i__6].r * temp2.r - b[i__6].i * temp2.i,
7448
z__3.i = b[i__6].r * temp2.i + b[i__6].i *
7450
z__1.r = z__2.r + z__3.r, z__1.i = z__2.i + z__3.i;
7451
d__1 = c__[i__4].r + z__1.r;
7452
c__[i__3].r = d__1, c__[i__3].i = 0.;
7462
Form C := alpha*conjg( A' )*B + conjg( alpha )*conjg( B' )*A +
7468
for (j = 1; j <= i__1; ++j) {
7470
for (i__ = 1; i__ <= i__2; ++i__) {
7471
temp1.r = 0., temp1.i = 0.;
7472
temp2.r = 0., temp2.i = 0.;
7474
for (l = 1; l <= i__3; ++l) {
7475
d_cnjg(&z__3, &a[l + i__ * a_dim1]);
7476
i__4 = l + j * b_dim1;
7477
z__2.r = z__3.r * b[i__4].r - z__3.i * b[i__4].i,
7478
z__2.i = z__3.r * b[i__4].i + z__3.i * b[i__4]
7480
z__1.r = temp1.r + z__2.r, z__1.i = temp1.i + z__2.i;
7481
temp1.r = z__1.r, temp1.i = z__1.i;
7482
d_cnjg(&z__3, &b[l + i__ * b_dim1]);
7483
i__4 = l + j * a_dim1;
7484
z__2.r = z__3.r * a[i__4].r - z__3.i * a[i__4].i,
7485
z__2.i = z__3.r * a[i__4].i + z__3.i * a[i__4]
7487
z__1.r = temp2.r + z__2.r, z__1.i = temp2.i + z__2.i;
7488
temp2.r = z__1.r, temp2.i = z__1.i;
7493
i__3 = j + j * c_dim1;
7494
z__2.r = alpha->r * temp1.r - alpha->i * temp1.i,
7495
z__2.i = alpha->r * temp1.i + alpha->i *
7497
d_cnjg(&z__4, alpha);
7498
z__3.r = z__4.r * temp2.r - z__4.i * temp2.i,
7499
z__3.i = z__4.r * temp2.i + z__4.i *
7501
z__1.r = z__2.r + z__3.r, z__1.i = z__2.i +
7504
c__[i__3].r = d__1, c__[i__3].i = 0.;
7506
i__3 = j + j * c_dim1;
7507
i__4 = j + j * c_dim1;
7508
z__2.r = alpha->r * temp1.r - alpha->i * temp1.i,
7509
z__2.i = alpha->r * temp1.i + alpha->i *
7511
d_cnjg(&z__4, alpha);
7512
z__3.r = z__4.r * temp2.r - z__4.i * temp2.i,
7513
z__3.i = z__4.r * temp2.i + z__4.i *
7515
z__1.r = z__2.r + z__3.r, z__1.i = z__2.i +
7517
d__1 = *beta * c__[i__4].r + z__1.r;
7518
c__[i__3].r = d__1, c__[i__3].i = 0.;
7522
i__3 = i__ + j * c_dim1;
7523
z__2.r = alpha->r * temp1.r - alpha->i * temp1.i,
7524
z__2.i = alpha->r * temp1.i + alpha->i *
7526
d_cnjg(&z__4, alpha);
7527
z__3.r = z__4.r * temp2.r - z__4.i * temp2.i,
7528
z__3.i = z__4.r * temp2.i + z__4.i *
7530
z__1.r = z__2.r + z__3.r, z__1.i = z__2.i +
7532
c__[i__3].r = z__1.r, c__[i__3].i = z__1.i;
7534
i__3 = i__ + j * c_dim1;
7535
i__4 = i__ + j * c_dim1;
7536
z__3.r = *beta * c__[i__4].r, z__3.i = *beta *
7538
z__4.r = alpha->r * temp1.r - alpha->i * temp1.i,
7539
z__4.i = alpha->r * temp1.i + alpha->i *
7541
z__2.r = z__3.r + z__4.r, z__2.i = z__3.i +
7543
d_cnjg(&z__6, alpha);
7544
z__5.r = z__6.r * temp2.r - z__6.i * temp2.i,
7545
z__5.i = z__6.r * temp2.i + z__6.i *
7547
z__1.r = z__2.r + z__5.r, z__1.i = z__2.i +
7549
c__[i__3].r = z__1.r, c__[i__3].i = z__1.i;
7558
for (j = 1; j <= i__1; ++j) {
7560
for (i__ = j; i__ <= i__2; ++i__) {
7561
temp1.r = 0., temp1.i = 0.;
7562
temp2.r = 0., temp2.i = 0.;
7564
for (l = 1; l <= i__3; ++l) {
7565
d_cnjg(&z__3, &a[l + i__ * a_dim1]);
7566
i__4 = l + j * b_dim1;
7567
z__2.r = z__3.r * b[i__4].r - z__3.i * b[i__4].i,
7568
z__2.i = z__3.r * b[i__4].i + z__3.i * b[i__4]
7570
z__1.r = temp1.r + z__2.r, z__1.i = temp1.i + z__2.i;
7571
temp1.r = z__1.r, temp1.i = z__1.i;
7572
d_cnjg(&z__3, &b[l + i__ * b_dim1]);
7573
i__4 = l + j * a_dim1;
7574
z__2.r = z__3.r * a[i__4].r - z__3.i * a[i__4].i,
7575
z__2.i = z__3.r * a[i__4].i + z__3.i * a[i__4]
7577
z__1.r = temp2.r + z__2.r, z__1.i = temp2.i + z__2.i;
7578
temp2.r = z__1.r, temp2.i = z__1.i;
7583
i__3 = j + j * c_dim1;
7584
z__2.r = alpha->r * temp1.r - alpha->i * temp1.i,
7585
z__2.i = alpha->r * temp1.i + alpha->i *
7587
d_cnjg(&z__4, alpha);
7588
z__3.r = z__4.r * temp2.r - z__4.i * temp2.i,
7589
z__3.i = z__4.r * temp2.i + z__4.i *
7591
z__1.r = z__2.r + z__3.r, z__1.i = z__2.i +
7594
c__[i__3].r = d__1, c__[i__3].i = 0.;
7596
i__3 = j + j * c_dim1;
7597
i__4 = j + j * c_dim1;
7598
z__2.r = alpha->r * temp1.r - alpha->i * temp1.i,
7599
z__2.i = alpha->r * temp1.i + alpha->i *
7601
d_cnjg(&z__4, alpha);
7602
z__3.r = z__4.r * temp2.r - z__4.i * temp2.i,
7603
z__3.i = z__4.r * temp2.i + z__4.i *
7605
z__1.r = z__2.r + z__3.r, z__1.i = z__2.i +
7607
d__1 = *beta * c__[i__4].r + z__1.r;
7608
c__[i__3].r = d__1, c__[i__3].i = 0.;
7612
i__3 = i__ + j * c_dim1;
7613
z__2.r = alpha->r * temp1.r - alpha->i * temp1.i,
7614
z__2.i = alpha->r * temp1.i + alpha->i *
7616
d_cnjg(&z__4, alpha);
7617
z__3.r = z__4.r * temp2.r - z__4.i * temp2.i,
7618
z__3.i = z__4.r * temp2.i + z__4.i *
7620
z__1.r = z__2.r + z__3.r, z__1.i = z__2.i +
7622
c__[i__3].r = z__1.r, c__[i__3].i = z__1.i;
7624
i__3 = i__ + j * c_dim1;
7625
i__4 = i__ + j * c_dim1;
7626
z__3.r = *beta * c__[i__4].r, z__3.i = *beta *
7628
z__4.r = alpha->r * temp1.r - alpha->i * temp1.i,
7629
z__4.i = alpha->r * temp1.i + alpha->i *
7631
z__2.r = z__3.r + z__4.r, z__2.i = z__3.i +
7633
d_cnjg(&z__6, alpha);
7634
z__5.r = z__6.r * temp2.r - z__6.i * temp2.i,
7635
z__5.i = z__6.r * temp2.i + z__6.i *
7637
z__1.r = z__2.r + z__5.r, z__1.i = z__2.i +
7639
c__[i__3].r = z__1.r, c__[i__3].i = z__1.i;
7651
/* End of ZHER2K. */
7655
/* Subroutine */ int zherk_(char *uplo, char *trans, integer *n, integer *k,
7656
doublereal *alpha, doublecomplex *a, integer *lda, doublereal *beta,
7657
doublecomplex *c__, integer *ldc)
7659
/* System generated locals */
7660
integer a_dim1, a_offset, c_dim1, c_offset, i__1, i__2, i__3, i__4, i__5,
7663
doublecomplex z__1, z__2, z__3;
7665
/* Builtin functions */
7666
void d_cnjg(doublecomplex *, doublecomplex *);
7668
/* Local variables */
7669
static integer i__, j, l, info;
7670
static doublecomplex temp;
7671
extern logical lsame_(char *, char *);
7672
static integer nrowa;
7673
static doublereal rtemp;
7674
static logical upper;
7675
extern /* Subroutine */ int xerbla_(char *, integer *);
7682
ZHERK performs one of the hermitian rank k operations
7684
C := alpha*A*conjg( A' ) + beta*C,
7688
C := alpha*conjg( A' )*A + beta*C,
7690
where alpha and beta are real scalars, C is an n by n hermitian
7691
matrix and A is an n by k matrix in the first case and a k by n
7692
matrix in the second case.
7698
On entry, UPLO specifies whether the upper or lower
7699
triangular part of the array C is to be referenced as
7702
UPLO = 'U' or 'u' Only the upper triangular part of C
7703
is to be referenced.
7705
UPLO = 'L' or 'l' Only the lower triangular part of C
7706
is to be referenced.
7710
TRANS - CHARACTER*1.
7711
On entry, TRANS specifies the operation to be performed as
7714
TRANS = 'N' or 'n' C := alpha*A*conjg( A' ) + beta*C.
7716
TRANS = 'C' or 'c' C := alpha*conjg( A' )*A + beta*C.
7721
On entry, N specifies the order of the matrix C. N must be
7726
On entry with TRANS = 'N' or 'n', K specifies the number
7727
of columns of the matrix A, and on entry with
7728
TRANS = 'C' or 'c', K specifies the number of rows of the
7729
matrix A. K must be at least zero.
7732
ALPHA - DOUBLE PRECISION .
7733
On entry, ALPHA specifies the scalar alpha.
7736
A - COMPLEX*16 array of DIMENSION ( LDA, ka ), where ka is
7737
k when TRANS = 'N' or 'n', and is n otherwise.
7738
Before entry with TRANS = 'N' or 'n', the leading n by k
7739
part of the array A must contain the matrix A, otherwise
7740
the leading k by n part of the array A must contain the
7745
On entry, LDA specifies the first dimension of A as declared
7746
in the calling (sub) program. When TRANS = 'N' or 'n'
7747
then LDA must be at least max( 1, n ), otherwise LDA must
7748
be at least max( 1, k ).
7751
BETA - DOUBLE PRECISION.
7752
On entry, BETA specifies the scalar beta.
7755
C - COMPLEX*16 array of DIMENSION ( LDC, n ).
7756
Before entry with UPLO = 'U' or 'u', the leading n by n
7757
upper triangular part of the array C must contain the upper
7758
triangular part of the hermitian matrix and the strictly
7759
lower triangular part of C is not referenced. On exit, the
7760
upper triangular part of the array C is overwritten by the
7761
upper triangular part of the updated matrix.
7762
Before entry with UPLO = 'L' or 'l', the leading n by n
7763
lower triangular part of the array C must contain the lower
7764
triangular part of the hermitian matrix and the strictly
7765
upper triangular part of C is not referenced. On exit, the
7766
lower triangular part of the array C is overwritten by the
7767
lower triangular part of the updated matrix.
7768
Note that the imaginary parts of the diagonal elements need
7769
not be set, they are assumed to be zero, and on exit they
7773
On entry, LDC specifies the first dimension of C as declared
7774
in the calling (sub) program. LDC must be at least
7779
Level 3 Blas routine.
7781
-- Written on 8-February-1989.
7782
Jack Dongarra, Argonne National Laboratory.
7783
Iain Duff, AERE Harwell.
7784
Jeremy Du Croz, Numerical Algorithms Group Ltd.
7785
Sven Hammarling, Numerical Algorithms Group Ltd.
7787
-- Modified 8-Nov-93 to set C(J,J) to DBLE( C(J,J) ) when BETA = 1.
7788
Ed Anderson, Cray Research Inc.
7791
Test the input parameters.
7794
/* Parameter adjustments */
7796
a_offset = 1 + a_dim1 * 1;
7799
c_offset = 1 + c_dim1 * 1;
7803
if (lsame_(trans, "N")) {
7808
upper = lsame_(uplo, "U");
7811
if ((! upper && ! lsame_(uplo, "L"))) {
7813
} else if ((! lsame_(trans, "N") && ! lsame_(trans,
7816
} else if (*n < 0) {
7818
} else if (*k < 0) {
7820
} else if (*lda < max(1,nrowa)) {
7822
} else if (*ldc < max(1,*n)) {
7826
xerbla_("ZHERK ", &info);
7830
/* Quick return if possible. */
7832
if (*n == 0 || ((*alpha == 0. || *k == 0) && *beta == 1.)) {
7836
/* And when alpha.eq.zero. */
7842
for (j = 1; j <= i__1; ++j) {
7844
for (i__ = 1; i__ <= i__2; ++i__) {
7845
i__3 = i__ + j * c_dim1;
7846
c__[i__3].r = 0., c__[i__3].i = 0.;
7853
for (j = 1; j <= i__1; ++j) {
7855
for (i__ = 1; i__ <= i__2; ++i__) {
7856
i__3 = i__ + j * c_dim1;
7857
i__4 = i__ + j * c_dim1;
7858
z__1.r = *beta * c__[i__4].r, z__1.i = *beta * c__[
7860
c__[i__3].r = z__1.r, c__[i__3].i = z__1.i;
7863
i__2 = j + j * c_dim1;
7864
i__3 = j + j * c_dim1;
7865
d__1 = *beta * c__[i__3].r;
7866
c__[i__2].r = d__1, c__[i__2].i = 0.;
7873
for (j = 1; j <= i__1; ++j) {
7875
for (i__ = j; i__ <= i__2; ++i__) {
7876
i__3 = i__ + j * c_dim1;
7877
c__[i__3].r = 0., c__[i__3].i = 0.;
7884
for (j = 1; j <= i__1; ++j) {
7885
i__2 = j + j * c_dim1;
7886
i__3 = j + j * c_dim1;
7887
d__1 = *beta * c__[i__3].r;
7888
c__[i__2].r = d__1, c__[i__2].i = 0.;
7890
for (i__ = j + 1; i__ <= i__2; ++i__) {
7891
i__3 = i__ + j * c_dim1;
7892
i__4 = i__ + j * c_dim1;
7893
z__1.r = *beta * c__[i__4].r, z__1.i = *beta * c__[
7895
c__[i__3].r = z__1.r, c__[i__3].i = z__1.i;
7905
/* Start the operations. */
7907
if (lsame_(trans, "N")) {
7909
/* Form C := alpha*A*conjg( A' ) + beta*C. */
7913
for (j = 1; j <= i__1; ++j) {
7916
for (i__ = 1; i__ <= i__2; ++i__) {
7917
i__3 = i__ + j * c_dim1;
7918
c__[i__3].r = 0., c__[i__3].i = 0.;
7921
} else if (*beta != 1.) {
7923
for (i__ = 1; i__ <= i__2; ++i__) {
7924
i__3 = i__ + j * c_dim1;
7925
i__4 = i__ + j * c_dim1;
7926
z__1.r = *beta * c__[i__4].r, z__1.i = *beta * c__[
7928
c__[i__3].r = z__1.r, c__[i__3].i = z__1.i;
7931
i__2 = j + j * c_dim1;
7932
i__3 = j + j * c_dim1;
7933
d__1 = *beta * c__[i__3].r;
7934
c__[i__2].r = d__1, c__[i__2].i = 0.;
7936
i__2 = j + j * c_dim1;
7937
i__3 = j + j * c_dim1;
7939
c__[i__2].r = d__1, c__[i__2].i = 0.;
7942
for (l = 1; l <= i__2; ++l) {
7943
i__3 = j + l * a_dim1;
7944
if (a[i__3].r != 0. || a[i__3].i != 0.) {
7945
d_cnjg(&z__2, &a[j + l * a_dim1]);
7946
z__1.r = *alpha * z__2.r, z__1.i = *alpha * z__2.i;
7947
temp.r = z__1.r, temp.i = z__1.i;
7949
for (i__ = 1; i__ <= i__3; ++i__) {
7950
i__4 = i__ + j * c_dim1;
7951
i__5 = i__ + j * c_dim1;
7952
i__6 = i__ + l * a_dim1;
7953
z__2.r = temp.r * a[i__6].r - temp.i * a[i__6].i,
7954
z__2.i = temp.r * a[i__6].i + temp.i * a[
7956
z__1.r = c__[i__5].r + z__2.r, z__1.i = c__[i__5]
7958
c__[i__4].r = z__1.r, c__[i__4].i = z__1.i;
7961
i__3 = j + j * c_dim1;
7962
i__4 = j + j * c_dim1;
7963
i__5 = i__ + l * a_dim1;
7964
z__1.r = temp.r * a[i__5].r - temp.i * a[i__5].i,
7965
z__1.i = temp.r * a[i__5].i + temp.i * a[i__5]
7967
d__1 = c__[i__4].r + z__1.r;
7968
c__[i__3].r = d__1, c__[i__3].i = 0.;
7976
for (j = 1; j <= i__1; ++j) {
7979
for (i__ = j; i__ <= i__2; ++i__) {
7980
i__3 = i__ + j * c_dim1;
7981
c__[i__3].r = 0., c__[i__3].i = 0.;
7984
} else if (*beta != 1.) {
7985
i__2 = j + j * c_dim1;
7986
i__3 = j + j * c_dim1;
7987
d__1 = *beta * c__[i__3].r;
7988
c__[i__2].r = d__1, c__[i__2].i = 0.;
7990
for (i__ = j + 1; i__ <= i__2; ++i__) {
7991
i__3 = i__ + j * c_dim1;
7992
i__4 = i__ + j * c_dim1;
7993
z__1.r = *beta * c__[i__4].r, z__1.i = *beta * c__[
7995
c__[i__3].r = z__1.r, c__[i__3].i = z__1.i;
7999
i__2 = j + j * c_dim1;
8000
i__3 = j + j * c_dim1;
8002
c__[i__2].r = d__1, c__[i__2].i = 0.;
8005
for (l = 1; l <= i__2; ++l) {
8006
i__3 = j + l * a_dim1;
8007
if (a[i__3].r != 0. || a[i__3].i != 0.) {
8008
d_cnjg(&z__2, &a[j + l * a_dim1]);
8009
z__1.r = *alpha * z__2.r, z__1.i = *alpha * z__2.i;
8010
temp.r = z__1.r, temp.i = z__1.i;
8011
i__3 = j + j * c_dim1;
8012
i__4 = j + j * c_dim1;
8013
i__5 = j + l * a_dim1;
8014
z__1.r = temp.r * a[i__5].r - temp.i * a[i__5].i,
8015
z__1.i = temp.r * a[i__5].i + temp.i * a[i__5]
8017
d__1 = c__[i__4].r + z__1.r;
8018
c__[i__3].r = d__1, c__[i__3].i = 0.;
8020
for (i__ = j + 1; i__ <= i__3; ++i__) {
8021
i__4 = i__ + j * c_dim1;
8022
i__5 = i__ + j * c_dim1;
8023
i__6 = i__ + l * a_dim1;
8024
z__2.r = temp.r * a[i__6].r - temp.i * a[i__6].i,
8025
z__2.i = temp.r * a[i__6].i + temp.i * a[
8027
z__1.r = c__[i__5].r + z__2.r, z__1.i = c__[i__5]
8029
c__[i__4].r = z__1.r, c__[i__4].i = z__1.i;
8040
/* Form C := alpha*conjg( A' )*A + beta*C. */
8044
for (j = 1; j <= i__1; ++j) {
8046
for (i__ = 1; i__ <= i__2; ++i__) {
8047
temp.r = 0., temp.i = 0.;
8049
for (l = 1; l <= i__3; ++l) {
8050
d_cnjg(&z__3, &a[l + i__ * a_dim1]);
8051
i__4 = l + j * a_dim1;
8052
z__2.r = z__3.r * a[i__4].r - z__3.i * a[i__4].i,
8053
z__2.i = z__3.r * a[i__4].i + z__3.i * a[i__4]
8055
z__1.r = temp.r + z__2.r, z__1.i = temp.i + z__2.i;
8056
temp.r = z__1.r, temp.i = z__1.i;
8060
i__3 = i__ + j * c_dim1;
8061
z__1.r = *alpha * temp.r, z__1.i = *alpha * temp.i;
8062
c__[i__3].r = z__1.r, c__[i__3].i = z__1.i;
8064
i__3 = i__ + j * c_dim1;
8065
z__2.r = *alpha * temp.r, z__2.i = *alpha * temp.i;
8066
i__4 = i__ + j * c_dim1;
8067
z__3.r = *beta * c__[i__4].r, z__3.i = *beta * c__[
8069
z__1.r = z__2.r + z__3.r, z__1.i = z__2.i + z__3.i;
8070
c__[i__3].r = z__1.r, c__[i__3].i = z__1.i;
8076
for (l = 1; l <= i__2; ++l) {
8077
d_cnjg(&z__3, &a[l + j * a_dim1]);
8078
i__3 = l + j * a_dim1;
8079
z__2.r = z__3.r * a[i__3].r - z__3.i * a[i__3].i, z__2.i =
8080
z__3.r * a[i__3].i + z__3.i * a[i__3].r;
8081
z__1.r = rtemp + z__2.r, z__1.i = z__2.i;
8086
i__2 = j + j * c_dim1;
8087
d__1 = *alpha * rtemp;
8088
c__[i__2].r = d__1, c__[i__2].i = 0.;
8090
i__2 = j + j * c_dim1;
8091
i__3 = j + j * c_dim1;
8092
d__1 = *alpha * rtemp + *beta * c__[i__3].r;
8093
c__[i__2].r = d__1, c__[i__2].i = 0.;
8099
for (j = 1; j <= i__1; ++j) {
8102
for (l = 1; l <= i__2; ++l) {
8103
d_cnjg(&z__3, &a[l + j * a_dim1]);
8104
i__3 = l + j * a_dim1;
8105
z__2.r = z__3.r * a[i__3].r - z__3.i * a[i__3].i, z__2.i =
8106
z__3.r * a[i__3].i + z__3.i * a[i__3].r;
8107
z__1.r = rtemp + z__2.r, z__1.i = z__2.i;
8112
i__2 = j + j * c_dim1;
8113
d__1 = *alpha * rtemp;
8114
c__[i__2].r = d__1, c__[i__2].i = 0.;
8116
i__2 = j + j * c_dim1;
8117
i__3 = j + j * c_dim1;
8118
d__1 = *alpha * rtemp + *beta * c__[i__3].r;
8119
c__[i__2].r = d__1, c__[i__2].i = 0.;
8122
for (i__ = j + 1; i__ <= i__2; ++i__) {
8123
temp.r = 0., temp.i = 0.;
8125
for (l = 1; l <= i__3; ++l) {
8126
d_cnjg(&z__3, &a[l + i__ * a_dim1]);
8127
i__4 = l + j * a_dim1;
8128
z__2.r = z__3.r * a[i__4].r - z__3.i * a[i__4].i,
8129
z__2.i = z__3.r * a[i__4].i + z__3.i * a[i__4]
8131
z__1.r = temp.r + z__2.r, z__1.i = temp.i + z__2.i;
8132
temp.r = z__1.r, temp.i = z__1.i;
8136
i__3 = i__ + j * c_dim1;
8137
z__1.r = *alpha * temp.r, z__1.i = *alpha * temp.i;
8138
c__[i__3].r = z__1.r, c__[i__3].i = z__1.i;
8140
i__3 = i__ + j * c_dim1;
8141
z__2.r = *alpha * temp.r, z__2.i = *alpha * temp.i;
8142
i__4 = i__ + j * c_dim1;
8143
z__3.r = *beta * c__[i__4].r, z__3.i = *beta * c__[
8145
z__1.r = z__2.r + z__3.r, z__1.i = z__2.i + z__3.i;
8146
c__[i__3].r = z__1.r, c__[i__3].i = z__1.i;
8157
/* End of ZHERK . */
8161
/* Subroutine */ int zscal_(integer *n, doublecomplex *za, doublecomplex *zx,
8164
/* System generated locals */
8165
integer i__1, i__2, i__3;
8168
/* Local variables */
8169
static integer i__, ix;
8173
scales a vector by a constant.
8174
jack dongarra, 3/11/78.
8175
modified 3/93 to return if incx .le. 0.
8176
modified 12/3/93, array(1) declarations changed to array(*)
8180
/* Parameter adjustments */
8184
if (*n <= 0 || *incx <= 0) {
8191
/* code for increment not equal to 1 */
8195
for (i__ = 1; i__ <= i__1; ++i__) {
8198
z__1.r = za->r * zx[i__3].r - za->i * zx[i__3].i, z__1.i = za->r * zx[
8199
i__3].i + za->i * zx[i__3].r;
8200
zx[i__2].r = z__1.r, zx[i__2].i = z__1.i;
8206
/* code for increment equal to 1 */
8210
for (i__ = 1; i__ <= i__1; ++i__) {
8213
z__1.r = za->r * zx[i__3].r - za->i * zx[i__3].i, z__1.i = za->r * zx[
8214
i__3].i + za->i * zx[i__3].r;
8215
zx[i__2].r = z__1.r, zx[i__2].i = z__1.i;
8221
/* Subroutine */ int zswap_(integer *n, doublecomplex *zx, integer *incx,
8222
doublecomplex *zy, integer *incy)
8224
/* System generated locals */
8225
integer i__1, i__2, i__3;
8227
/* Local variables */
8228
static integer i__, ix, iy;
8229
static doublecomplex ztemp;
8233
interchanges two vectors.
8234
jack dongarra, 3/11/78.
8235
modified 12/3/93, array(1) declarations changed to array(*)
8239
/* Parameter adjustments */
8247
if ((*incx == 1 && *incy == 1)) {
8252
code for unequal increments or equal increments not equal
8259
ix = (-(*n) + 1) * *incx + 1;
8262
iy = (-(*n) + 1) * *incy + 1;
8265
for (i__ = 1; i__ <= i__1; ++i__) {
8267
ztemp.r = zx[i__2].r, ztemp.i = zx[i__2].i;
8270
zx[i__2].r = zy[i__3].r, zx[i__2].i = zy[i__3].i;
8272
zy[i__2].r = ztemp.r, zy[i__2].i = ztemp.i;
8279
/* code for both increments equal to 1 */
8282
for (i__ = 1; i__ <= i__1; ++i__) {
8284
ztemp.r = zx[i__2].r, ztemp.i = zx[i__2].i;
8287
zx[i__2].r = zy[i__3].r, zx[i__2].i = zy[i__3].i;
8289
zy[i__2].r = ztemp.r, zy[i__2].i = ztemp.i;
8295
/* Subroutine */ int ztrmm_(char *side, char *uplo, char *transa, char *diag,
8296
integer *m, integer *n, doublecomplex *alpha, doublecomplex *a,
8297
integer *lda, doublecomplex *b, integer *ldb)
8299
/* System generated locals */
8300
integer a_dim1, a_offset, b_dim1, b_offset, i__1, i__2, i__3, i__4, i__5,
8302
doublecomplex z__1, z__2, z__3;
8304
/* Builtin functions */
8305
void d_cnjg(doublecomplex *, doublecomplex *);
8307
/* Local variables */
8308
static integer i__, j, k, info;
8309
static doublecomplex temp;
8310
static logical lside;
8311
extern logical lsame_(char *, char *);
8312
static integer nrowa;
8313
static logical upper;
8314
extern /* Subroutine */ int xerbla_(char *, integer *);
8315
static logical noconj, nounit;
8322
ZTRMM performs one of the matrix-matrix operations
8324
B := alpha*op( A )*B, or B := alpha*B*op( A )
8326
where alpha is a scalar, B is an m by n matrix, A is a unit, or
8327
non-unit, upper or lower triangular matrix and op( A ) is one of
8329
op( A ) = A or op( A ) = A' or op( A ) = conjg( A' ).
8335
On entry, SIDE specifies whether op( A ) multiplies B from
8336
the left or right as follows:
8338
SIDE = 'L' or 'l' B := alpha*op( A )*B.
8340
SIDE = 'R' or 'r' B := alpha*B*op( A ).
8345
On entry, UPLO specifies whether the matrix A is an upper or
8346
lower triangular matrix as follows:
8348
UPLO = 'U' or 'u' A is an upper triangular matrix.
8350
UPLO = 'L' or 'l' A is a lower triangular matrix.
8354
TRANSA - CHARACTER*1.
8355
On entry, TRANSA specifies the form of op( A ) to be used in
8356
the matrix multiplication as follows:
8358
TRANSA = 'N' or 'n' op( A ) = A.
8360
TRANSA = 'T' or 't' op( A ) = A'.
8362
TRANSA = 'C' or 'c' op( A ) = conjg( A' ).
8367
On entry, DIAG specifies whether or not A is unit triangular
8370
DIAG = 'U' or 'u' A is assumed to be unit triangular.
8372
DIAG = 'N' or 'n' A is not assumed to be unit
8378
On entry, M specifies the number of rows of B. M must be at
8383
On entry, N specifies the number of columns of B. N must be
8387
ALPHA - COMPLEX*16 .
8388
On entry, ALPHA specifies the scalar alpha. When alpha is
8389
zero then A is not referenced and B need not be set before
8393
A - COMPLEX*16 array of DIMENSION ( LDA, k ), where k is m
8394
when SIDE = 'L' or 'l' and is n when SIDE = 'R' or 'r'.
8395
Before entry with UPLO = 'U' or 'u', the leading k by k
8396
upper triangular part of the array A must contain the upper
8397
triangular matrix and the strictly lower triangular part of
8398
A is not referenced.
8399
Before entry with UPLO = 'L' or 'l', the leading k by k
8400
lower triangular part of the array A must contain the lower
8401
triangular matrix and the strictly upper triangular part of
8402
A is not referenced.
8403
Note that when DIAG = 'U' or 'u', the diagonal elements of
8404
A are not referenced either, but are assumed to be unity.
8408
On entry, LDA specifies the first dimension of A as declared
8409
in the calling (sub) program. When SIDE = 'L' or 'l' then
8410
LDA must be at least max( 1, m ), when SIDE = 'R' or 'r'
8411
then LDA must be at least max( 1, n ).
8414
B - COMPLEX*16 array of DIMENSION ( LDB, n ).
8415
Before entry, the leading m by n part of the array B must
8416
contain the matrix B, and on exit is overwritten by the
8420
On entry, LDB specifies the first dimension of B as declared
8421
in the calling (sub) program. LDB must be at least
8426
Level 3 Blas routine.
8428
-- Written on 8-February-1989.
8429
Jack Dongarra, Argonne National Laboratory.
8430
Iain Duff, AERE Harwell.
8431
Jeremy Du Croz, Numerical Algorithms Group Ltd.
8432
Sven Hammarling, Numerical Algorithms Group Ltd.
8435
Test the input parameters.
8438
/* Parameter adjustments */
8440
a_offset = 1 + a_dim1 * 1;
8443
b_offset = 1 + b_dim1 * 1;
8447
lside = lsame_(side, "L");
8453
noconj = lsame_(transa, "T");
8454
nounit = lsame_(diag, "N");
8455
upper = lsame_(uplo, "U");
8458
if ((! lside && ! lsame_(side, "R"))) {
8460
} else if ((! upper && ! lsame_(uplo, "L"))) {
8462
} else if (((! lsame_(transa, "N") && ! lsame_(
8463
transa, "T")) && ! lsame_(transa, "C"))) {
8465
} else if ((! lsame_(diag, "U") && ! lsame_(diag,
8468
} else if (*m < 0) {
8470
} else if (*n < 0) {
8472
} else if (*lda < max(1,nrowa)) {
8474
} else if (*ldb < max(1,*m)) {
8478
xerbla_("ZTRMM ", &info);
8482
/* Quick return if possible. */
8488
/* And when alpha.eq.zero. */
8490
if ((alpha->r == 0. && alpha->i == 0.)) {
8492
for (j = 1; j <= i__1; ++j) {
8494
for (i__ = 1; i__ <= i__2; ++i__) {
8495
i__3 = i__ + j * b_dim1;
8496
b[i__3].r = 0., b[i__3].i = 0.;
8504
/* Start the operations. */
8507
if (lsame_(transa, "N")) {
8509
/* Form B := alpha*A*B. */
8513
for (j = 1; j <= i__1; ++j) {
8515
for (k = 1; k <= i__2; ++k) {
8516
i__3 = k + j * b_dim1;
8517
if (b[i__3].r != 0. || b[i__3].i != 0.) {
8518
i__3 = k + j * b_dim1;
8519
z__1.r = alpha->r * b[i__3].r - alpha->i * b[i__3]
8520
.i, z__1.i = alpha->r * b[i__3].i +
8521
alpha->i * b[i__3].r;
8522
temp.r = z__1.r, temp.i = z__1.i;
8524
for (i__ = 1; i__ <= i__3; ++i__) {
8525
i__4 = i__ + j * b_dim1;
8526
i__5 = i__ + j * b_dim1;
8527
i__6 = i__ + k * a_dim1;
8528
z__2.r = temp.r * a[i__6].r - temp.i * a[i__6]
8529
.i, z__2.i = temp.r * a[i__6].i +
8531
z__1.r = b[i__5].r + z__2.r, z__1.i = b[i__5]
8533
b[i__4].r = z__1.r, b[i__4].i = z__1.i;
8537
i__3 = k + k * a_dim1;
8538
z__1.r = temp.r * a[i__3].r - temp.i * a[i__3]
8539
.i, z__1.i = temp.r * a[i__3].i +
8541
temp.r = z__1.r, temp.i = z__1.i;
8543
i__3 = k + j * b_dim1;
8544
b[i__3].r = temp.r, b[i__3].i = temp.i;
8552
for (j = 1; j <= i__1; ++j) {
8553
for (k = *m; k >= 1; --k) {
8554
i__2 = k + j * b_dim1;
8555
if (b[i__2].r != 0. || b[i__2].i != 0.) {
8556
i__2 = k + j * b_dim1;
8557
z__1.r = alpha->r * b[i__2].r - alpha->i * b[i__2]
8558
.i, z__1.i = alpha->r * b[i__2].i +
8559
alpha->i * b[i__2].r;
8560
temp.r = z__1.r, temp.i = z__1.i;
8561
i__2 = k + j * b_dim1;
8562
b[i__2].r = temp.r, b[i__2].i = temp.i;
8564
i__2 = k + j * b_dim1;
8565
i__3 = k + j * b_dim1;
8566
i__4 = k + k * a_dim1;
8567
z__1.r = b[i__3].r * a[i__4].r - b[i__3].i *
8568
a[i__4].i, z__1.i = b[i__3].r * a[
8569
i__4].i + b[i__3].i * a[i__4].r;
8570
b[i__2].r = z__1.r, b[i__2].i = z__1.i;
8573
for (i__ = k + 1; i__ <= i__2; ++i__) {
8574
i__3 = i__ + j * b_dim1;
8575
i__4 = i__ + j * b_dim1;
8576
i__5 = i__ + k * a_dim1;
8577
z__2.r = temp.r * a[i__5].r - temp.i * a[i__5]
8578
.i, z__2.i = temp.r * a[i__5].i +
8580
z__1.r = b[i__4].r + z__2.r, z__1.i = b[i__4]
8582
b[i__3].r = z__1.r, b[i__3].i = z__1.i;
8593
/* Form B := alpha*A'*B or B := alpha*conjg( A' )*B. */
8597
for (j = 1; j <= i__1; ++j) {
8598
for (i__ = *m; i__ >= 1; --i__) {
8599
i__2 = i__ + j * b_dim1;
8600
temp.r = b[i__2].r, temp.i = b[i__2].i;
8603
i__2 = i__ + i__ * a_dim1;
8604
z__1.r = temp.r * a[i__2].r - temp.i * a[i__2]
8605
.i, z__1.i = temp.r * a[i__2].i +
8607
temp.r = z__1.r, temp.i = z__1.i;
8610
for (k = 1; k <= i__2; ++k) {
8611
i__3 = k + i__ * a_dim1;
8612
i__4 = k + j * b_dim1;
8613
z__2.r = a[i__3].r * b[i__4].r - a[i__3].i *
8614
b[i__4].i, z__2.i = a[i__3].r * b[
8615
i__4].i + a[i__3].i * b[i__4].r;
8616
z__1.r = temp.r + z__2.r, z__1.i = temp.i +
8618
temp.r = z__1.r, temp.i = z__1.i;
8623
d_cnjg(&z__2, &a[i__ + i__ * a_dim1]);
8624
z__1.r = temp.r * z__2.r - temp.i * z__2.i,
8625
z__1.i = temp.r * z__2.i + temp.i *
8627
temp.r = z__1.r, temp.i = z__1.i;
8630
for (k = 1; k <= i__2; ++k) {
8631
d_cnjg(&z__3, &a[k + i__ * a_dim1]);
8632
i__3 = k + j * b_dim1;
8633
z__2.r = z__3.r * b[i__3].r - z__3.i * b[i__3]
8634
.i, z__2.i = z__3.r * b[i__3].i +
8636
z__1.r = temp.r + z__2.r, z__1.i = temp.i +
8638
temp.r = z__1.r, temp.i = z__1.i;
8642
i__2 = i__ + j * b_dim1;
8643
z__1.r = alpha->r * temp.r - alpha->i * temp.i,
8644
z__1.i = alpha->r * temp.i + alpha->i *
8646
b[i__2].r = z__1.r, b[i__2].i = z__1.i;
8653
for (j = 1; j <= i__1; ++j) {
8655
for (i__ = 1; i__ <= i__2; ++i__) {
8656
i__3 = i__ + j * b_dim1;
8657
temp.r = b[i__3].r, temp.i = b[i__3].i;
8660
i__3 = i__ + i__ * a_dim1;
8661
z__1.r = temp.r * a[i__3].r - temp.i * a[i__3]
8662
.i, z__1.i = temp.r * a[i__3].i +
8664
temp.r = z__1.r, temp.i = z__1.i;
8667
for (k = i__ + 1; k <= i__3; ++k) {
8668
i__4 = k + i__ * a_dim1;
8669
i__5 = k + j * b_dim1;
8670
z__2.r = a[i__4].r * b[i__5].r - a[i__4].i *
8671
b[i__5].i, z__2.i = a[i__4].r * b[
8672
i__5].i + a[i__4].i * b[i__5].r;
8673
z__1.r = temp.r + z__2.r, z__1.i = temp.i +
8675
temp.r = z__1.r, temp.i = z__1.i;
8680
d_cnjg(&z__2, &a[i__ + i__ * a_dim1]);
8681
z__1.r = temp.r * z__2.r - temp.i * z__2.i,
8682
z__1.i = temp.r * z__2.i + temp.i *
8684
temp.r = z__1.r, temp.i = z__1.i;
8687
for (k = i__ + 1; k <= i__3; ++k) {
8688
d_cnjg(&z__3, &a[k + i__ * a_dim1]);
8689
i__4 = k + j * b_dim1;
8690
z__2.r = z__3.r * b[i__4].r - z__3.i * b[i__4]
8691
.i, z__2.i = z__3.r * b[i__4].i +
8693
z__1.r = temp.r + z__2.r, z__1.i = temp.i +
8695
temp.r = z__1.r, temp.i = z__1.i;
8699
i__3 = i__ + j * b_dim1;
8700
z__1.r = alpha->r * temp.r - alpha->i * temp.i,
8701
z__1.i = alpha->r * temp.i + alpha->i *
8703
b[i__3].r = z__1.r, b[i__3].i = z__1.i;
8711
if (lsame_(transa, "N")) {
8713
/* Form B := alpha*B*A. */
8716
for (j = *n; j >= 1; --j) {
8717
temp.r = alpha->r, temp.i = alpha->i;
8719
i__1 = j + j * a_dim1;
8720
z__1.r = temp.r * a[i__1].r - temp.i * a[i__1].i,
8721
z__1.i = temp.r * a[i__1].i + temp.i * a[i__1]
8723
temp.r = z__1.r, temp.i = z__1.i;
8726
for (i__ = 1; i__ <= i__1; ++i__) {
8727
i__2 = i__ + j * b_dim1;
8728
i__3 = i__ + j * b_dim1;
8729
z__1.r = temp.r * b[i__3].r - temp.i * b[i__3].i,
8730
z__1.i = temp.r * b[i__3].i + temp.i * b[i__3]
8732
b[i__2].r = z__1.r, b[i__2].i = z__1.i;
8736
for (k = 1; k <= i__1; ++k) {
8737
i__2 = k + j * a_dim1;
8738
if (a[i__2].r != 0. || a[i__2].i != 0.) {
8739
i__2 = k + j * a_dim1;
8740
z__1.r = alpha->r * a[i__2].r - alpha->i * a[i__2]
8741
.i, z__1.i = alpha->r * a[i__2].i +
8742
alpha->i * a[i__2].r;
8743
temp.r = z__1.r, temp.i = z__1.i;
8745
for (i__ = 1; i__ <= i__2; ++i__) {
8746
i__3 = i__ + j * b_dim1;
8747
i__4 = i__ + j * b_dim1;
8748
i__5 = i__ + k * b_dim1;
8749
z__2.r = temp.r * b[i__5].r - temp.i * b[i__5]
8750
.i, z__2.i = temp.r * b[i__5].i +
8752
z__1.r = b[i__4].r + z__2.r, z__1.i = b[i__4]
8754
b[i__3].r = z__1.r, b[i__3].i = z__1.i;
8764
for (j = 1; j <= i__1; ++j) {
8765
temp.r = alpha->r, temp.i = alpha->i;
8767
i__2 = j + j * a_dim1;
8768
z__1.r = temp.r * a[i__2].r - temp.i * a[i__2].i,
8769
z__1.i = temp.r * a[i__2].i + temp.i * a[i__2]
8771
temp.r = z__1.r, temp.i = z__1.i;
8774
for (i__ = 1; i__ <= i__2; ++i__) {
8775
i__3 = i__ + j * b_dim1;
8776
i__4 = i__ + j * b_dim1;
8777
z__1.r = temp.r * b[i__4].r - temp.i * b[i__4].i,
8778
z__1.i = temp.r * b[i__4].i + temp.i * b[i__4]
8780
b[i__3].r = z__1.r, b[i__3].i = z__1.i;
8784
for (k = j + 1; k <= i__2; ++k) {
8785
i__3 = k + j * a_dim1;
8786
if (a[i__3].r != 0. || a[i__3].i != 0.) {
8787
i__3 = k + j * a_dim1;
8788
z__1.r = alpha->r * a[i__3].r - alpha->i * a[i__3]
8789
.i, z__1.i = alpha->r * a[i__3].i +
8790
alpha->i * a[i__3].r;
8791
temp.r = z__1.r, temp.i = z__1.i;
8793
for (i__ = 1; i__ <= i__3; ++i__) {
8794
i__4 = i__ + j * b_dim1;
8795
i__5 = i__ + j * b_dim1;
8796
i__6 = i__ + k * b_dim1;
8797
z__2.r = temp.r * b[i__6].r - temp.i * b[i__6]
8798
.i, z__2.i = temp.r * b[i__6].i +
8800
z__1.r = b[i__5].r + z__2.r, z__1.i = b[i__5]
8802
b[i__4].r = z__1.r, b[i__4].i = z__1.i;
8813
/* Form B := alpha*B*A' or B := alpha*B*conjg( A' ). */
8817
for (k = 1; k <= i__1; ++k) {
8819
for (j = 1; j <= i__2; ++j) {
8820
i__3 = j + k * a_dim1;
8821
if (a[i__3].r != 0. || a[i__3].i != 0.) {
8823
i__3 = j + k * a_dim1;
8824
z__1.r = alpha->r * a[i__3].r - alpha->i * a[
8825
i__3].i, z__1.i = alpha->r * a[i__3]
8826
.i + alpha->i * a[i__3].r;
8827
temp.r = z__1.r, temp.i = z__1.i;
8829
d_cnjg(&z__2, &a[j + k * a_dim1]);
8830
z__1.r = alpha->r * z__2.r - alpha->i *
8831
z__2.i, z__1.i = alpha->r * z__2.i +
8833
temp.r = z__1.r, temp.i = z__1.i;
8836
for (i__ = 1; i__ <= i__3; ++i__) {
8837
i__4 = i__ + j * b_dim1;
8838
i__5 = i__ + j * b_dim1;
8839
i__6 = i__ + k * b_dim1;
8840
z__2.r = temp.r * b[i__6].r - temp.i * b[i__6]
8841
.i, z__2.i = temp.r * b[i__6].i +
8843
z__1.r = b[i__5].r + z__2.r, z__1.i = b[i__5]
8845
b[i__4].r = z__1.r, b[i__4].i = z__1.i;
8851
temp.r = alpha->r, temp.i = alpha->i;
8854
i__2 = k + k * a_dim1;
8855
z__1.r = temp.r * a[i__2].r - temp.i * a[i__2].i,
8856
z__1.i = temp.r * a[i__2].i + temp.i * a[
8858
temp.r = z__1.r, temp.i = z__1.i;
8860
d_cnjg(&z__2, &a[k + k * a_dim1]);
8861
z__1.r = temp.r * z__2.r - temp.i * z__2.i,
8862
z__1.i = temp.r * z__2.i + temp.i *
8864
temp.r = z__1.r, temp.i = z__1.i;
8867
if (temp.r != 1. || temp.i != 0.) {
8869
for (i__ = 1; i__ <= i__2; ++i__) {
8870
i__3 = i__ + k * b_dim1;
8871
i__4 = i__ + k * b_dim1;
8872
z__1.r = temp.r * b[i__4].r - temp.i * b[i__4].i,
8873
z__1.i = temp.r * b[i__4].i + temp.i * b[
8875
b[i__3].r = z__1.r, b[i__3].i = z__1.i;
8882
for (k = *n; k >= 1; --k) {
8884
for (j = k + 1; j <= i__1; ++j) {
8885
i__2 = j + k * a_dim1;
8886
if (a[i__2].r != 0. || a[i__2].i != 0.) {
8888
i__2 = j + k * a_dim1;
8889
z__1.r = alpha->r * a[i__2].r - alpha->i * a[
8890
i__2].i, z__1.i = alpha->r * a[i__2]
8891
.i + alpha->i * a[i__2].r;
8892
temp.r = z__1.r, temp.i = z__1.i;
8894
d_cnjg(&z__2, &a[j + k * a_dim1]);
8895
z__1.r = alpha->r * z__2.r - alpha->i *
8896
z__2.i, z__1.i = alpha->r * z__2.i +
8898
temp.r = z__1.r, temp.i = z__1.i;
8901
for (i__ = 1; i__ <= i__2; ++i__) {
8902
i__3 = i__ + j * b_dim1;
8903
i__4 = i__ + j * b_dim1;
8904
i__5 = i__ + k * b_dim1;
8905
z__2.r = temp.r * b[i__5].r - temp.i * b[i__5]
8906
.i, z__2.i = temp.r * b[i__5].i +
8908
z__1.r = b[i__4].r + z__2.r, z__1.i = b[i__4]
8910
b[i__3].r = z__1.r, b[i__3].i = z__1.i;
8916
temp.r = alpha->r, temp.i = alpha->i;
8919
i__1 = k + k * a_dim1;
8920
z__1.r = temp.r * a[i__1].r - temp.i * a[i__1].i,
8921
z__1.i = temp.r * a[i__1].i + temp.i * a[
8923
temp.r = z__1.r, temp.i = z__1.i;
8925
d_cnjg(&z__2, &a[k + k * a_dim1]);
8926
z__1.r = temp.r * z__2.r - temp.i * z__2.i,
8927
z__1.i = temp.r * z__2.i + temp.i *
8929
temp.r = z__1.r, temp.i = z__1.i;
8932
if (temp.r != 1. || temp.i != 0.) {
8934
for (i__ = 1; i__ <= i__1; ++i__) {
8935
i__2 = i__ + k * b_dim1;
8936
i__3 = i__ + k * b_dim1;
8937
z__1.r = temp.r * b[i__3].r - temp.i * b[i__3].i,
8938
z__1.i = temp.r * b[i__3].i + temp.i * b[
8940
b[i__2].r = z__1.r, b[i__2].i = z__1.i;
8952
/* End of ZTRMM . */
8956
/* Subroutine */ int ztrmv_(char *uplo, char *trans, char *diag, integer *n,
8957
doublecomplex *a, integer *lda, doublecomplex *x, integer *incx)
8959
/* System generated locals */
8960
integer a_dim1, a_offset, i__1, i__2, i__3, i__4, i__5;
8961
doublecomplex z__1, z__2, z__3;
8963
/* Builtin functions */
8964
void d_cnjg(doublecomplex *, doublecomplex *);
8966
/* Local variables */
8967
static integer i__, j, ix, jx, kx, info;
8968
static doublecomplex temp;
8969
extern logical lsame_(char *, char *);
8970
extern /* Subroutine */ int xerbla_(char *, integer *);
8971
static logical noconj, nounit;
8978
ZTRMV performs one of the matrix-vector operations
8980
x := A*x, or x := A'*x, or x := conjg( A' )*x,
8982
where x is an n element vector and A is an n by n unit, or non-unit,
8983
upper or lower triangular matrix.
8989
On entry, UPLO specifies whether the matrix is an upper or
8990
lower triangular matrix as follows:
8992
UPLO = 'U' or 'u' A is an upper triangular matrix.
8994
UPLO = 'L' or 'l' A is a lower triangular matrix.
8998
TRANS - CHARACTER*1.
8999
On entry, TRANS specifies the operation to be performed as
9002
TRANS = 'N' or 'n' x := A*x.
9004
TRANS = 'T' or 't' x := A'*x.
9006
TRANS = 'C' or 'c' x := conjg( A' )*x.
9011
On entry, DIAG specifies whether or not A is unit
9012
triangular as follows:
9014
DIAG = 'U' or 'u' A is assumed to be unit triangular.
9016
DIAG = 'N' or 'n' A is not assumed to be unit
9022
On entry, N specifies the order of the matrix A.
9023
N must be at least zero.
9026
A - COMPLEX*16 array of DIMENSION ( LDA, n ).
9027
Before entry with UPLO = 'U' or 'u', the leading n by n
9028
upper triangular part of the array A must contain the upper
9029
triangular matrix and the strictly lower triangular part of
9030
A is not referenced.
9031
Before entry with UPLO = 'L' or 'l', the leading n by n
9032
lower triangular part of the array A must contain the lower
9033
triangular matrix and the strictly upper triangular part of
9034
A is not referenced.
9035
Note that when DIAG = 'U' or 'u', the diagonal elements of
9036
A are not referenced either, but are assumed to be unity.
9040
On entry, LDA specifies the first dimension of A as declared
9041
in the calling (sub) program. LDA must be at least
9045
X - COMPLEX*16 array of dimension at least
9046
( 1 + ( n - 1 )*abs( INCX ) ).
9047
Before entry, the incremented array X must contain the n
9048
element vector x. On exit, X is overwritten with the
9049
tranformed vector x.
9052
On entry, INCX specifies the increment for the elements of
9053
X. INCX must not be zero.
9057
Level 2 Blas routine.
9059
-- Written on 22-October-1986.
9060
Jack Dongarra, Argonne National Lab.
9061
Jeremy Du Croz, Nag Central Office.
9062
Sven Hammarling, Nag Central Office.
9063
Richard Hanson, Sandia National Labs.
9066
Test the input parameters.
9069
/* Parameter adjustments */
9071
a_offset = 1 + a_dim1 * 1;
9077
if ((! lsame_(uplo, "U") && ! lsame_(uplo, "L"))) {
9079
} else if (((! lsame_(trans, "N") && ! lsame_(trans,
9080
"T")) && ! lsame_(trans, "C"))) {
9082
} else if ((! lsame_(diag, "U") && ! lsame_(diag,
9085
} else if (*n < 0) {
9087
} else if (*lda < max(1,*n)) {
9089
} else if (*incx == 0) {
9093
xerbla_("ZTRMV ", &info);
9097
/* Quick return if possible. */
9103
noconj = lsame_(trans, "T");
9104
nounit = lsame_(diag, "N");
9107
Set up the start point in X if the increment is not unity. This
9108
will be ( N - 1 )*INCX too small for descending loops.
9112
kx = 1 - (*n - 1) * *incx;
9113
} else if (*incx != 1) {
9118
Start the operations. In this version the elements of A are
9119
accessed sequentially with one pass through A.
9122
if (lsame_(trans, "N")) {
9124
/* Form x := A*x. */
9126
if (lsame_(uplo, "U")) {
9129
for (j = 1; j <= i__1; ++j) {
9131
if (x[i__2].r != 0. || x[i__2].i != 0.) {
9133
temp.r = x[i__2].r, temp.i = x[i__2].i;
9135
for (i__ = 1; i__ <= i__2; ++i__) {
9138
i__5 = i__ + j * a_dim1;
9139
z__2.r = temp.r * a[i__5].r - temp.i * a[i__5].i,
9140
z__2.i = temp.r * a[i__5].i + temp.i * a[
9142
z__1.r = x[i__4].r + z__2.r, z__1.i = x[i__4].i +
9144
x[i__3].r = z__1.r, x[i__3].i = z__1.i;
9150
i__4 = j + j * a_dim1;
9151
z__1.r = x[i__3].r * a[i__4].r - x[i__3].i * a[
9152
i__4].i, z__1.i = x[i__3].r * a[i__4].i +
9153
x[i__3].i * a[i__4].r;
9154
x[i__2].r = z__1.r, x[i__2].i = z__1.i;
9162
for (j = 1; j <= i__1; ++j) {
9164
if (x[i__2].r != 0. || x[i__2].i != 0.) {
9166
temp.r = x[i__2].r, temp.i = x[i__2].i;
9169
for (i__ = 1; i__ <= i__2; ++i__) {
9172
i__5 = i__ + j * a_dim1;
9173
z__2.r = temp.r * a[i__5].r - temp.i * a[i__5].i,
9174
z__2.i = temp.r * a[i__5].i + temp.i * a[
9176
z__1.r = x[i__4].r + z__2.r, z__1.i = x[i__4].i +
9178
x[i__3].r = z__1.r, x[i__3].i = z__1.i;
9185
i__4 = j + j * a_dim1;
9186
z__1.r = x[i__3].r * a[i__4].r - x[i__3].i * a[
9187
i__4].i, z__1.i = x[i__3].r * a[i__4].i +
9188
x[i__3].i * a[i__4].r;
9189
x[i__2].r = z__1.r, x[i__2].i = z__1.i;
9198
for (j = *n; j >= 1; --j) {
9200
if (x[i__1].r != 0. || x[i__1].i != 0.) {
9202
temp.r = x[i__1].r, temp.i = x[i__1].i;
9204
for (i__ = *n; i__ >= i__1; --i__) {
9207
i__4 = i__ + j * a_dim1;
9208
z__2.r = temp.r * a[i__4].r - temp.i * a[i__4].i,
9209
z__2.i = temp.r * a[i__4].i + temp.i * a[
9211
z__1.r = x[i__3].r + z__2.r, z__1.i = x[i__3].i +
9213
x[i__2].r = z__1.r, x[i__2].i = z__1.i;
9219
i__3 = j + j * a_dim1;
9220
z__1.r = x[i__2].r * a[i__3].r - x[i__2].i * a[
9221
i__3].i, z__1.i = x[i__2].r * a[i__3].i +
9222
x[i__2].i * a[i__3].r;
9223
x[i__1].r = z__1.r, x[i__1].i = z__1.i;
9229
kx += (*n - 1) * *incx;
9231
for (j = *n; j >= 1; --j) {
9233
if (x[i__1].r != 0. || x[i__1].i != 0.) {
9235
temp.r = x[i__1].r, temp.i = x[i__1].i;
9238
for (i__ = *n; i__ >= i__1; --i__) {
9241
i__4 = i__ + j * a_dim1;
9242
z__2.r = temp.r * a[i__4].r - temp.i * a[i__4].i,
9243
z__2.i = temp.r * a[i__4].i + temp.i * a[
9245
z__1.r = x[i__3].r + z__2.r, z__1.i = x[i__3].i +
9247
x[i__2].r = z__1.r, x[i__2].i = z__1.i;
9254
i__3 = j + j * a_dim1;
9255
z__1.r = x[i__2].r * a[i__3].r - x[i__2].i * a[
9256
i__3].i, z__1.i = x[i__2].r * a[i__3].i +
9257
x[i__2].i * a[i__3].r;
9258
x[i__1].r = z__1.r, x[i__1].i = z__1.i;
9268
/* Form x := A'*x or x := conjg( A' )*x. */
9270
if (lsame_(uplo, "U")) {
9272
for (j = *n; j >= 1; --j) {
9274
temp.r = x[i__1].r, temp.i = x[i__1].i;
9277
i__1 = j + j * a_dim1;
9278
z__1.r = temp.r * a[i__1].r - temp.i * a[i__1].i,
9279
z__1.i = temp.r * a[i__1].i + temp.i * a[
9281
temp.r = z__1.r, temp.i = z__1.i;
9283
for (i__ = j - 1; i__ >= 1; --i__) {
9284
i__1 = i__ + j * a_dim1;
9286
z__2.r = a[i__1].r * x[i__2].r - a[i__1].i * x[
9287
i__2].i, z__2.i = a[i__1].r * x[i__2].i +
9288
a[i__1].i * x[i__2].r;
9289
z__1.r = temp.r + z__2.r, z__1.i = temp.i +
9291
temp.r = z__1.r, temp.i = z__1.i;
9296
d_cnjg(&z__2, &a[j + j * a_dim1]);
9297
z__1.r = temp.r * z__2.r - temp.i * z__2.i,
9298
z__1.i = temp.r * z__2.i + temp.i *
9300
temp.r = z__1.r, temp.i = z__1.i;
9302
for (i__ = j - 1; i__ >= 1; --i__) {
9303
d_cnjg(&z__3, &a[i__ + j * a_dim1]);
9305
z__2.r = z__3.r * x[i__1].r - z__3.i * x[i__1].i,
9306
z__2.i = z__3.r * x[i__1].i + z__3.i * x[
9308
z__1.r = temp.r + z__2.r, z__1.i = temp.i +
9310
temp.r = z__1.r, temp.i = z__1.i;
9315
x[i__1].r = temp.r, x[i__1].i = temp.i;
9319
jx = kx + (*n - 1) * *incx;
9320
for (j = *n; j >= 1; --j) {
9322
temp.r = x[i__1].r, temp.i = x[i__1].i;
9326
i__1 = j + j * a_dim1;
9327
z__1.r = temp.r * a[i__1].r - temp.i * a[i__1].i,
9328
z__1.i = temp.r * a[i__1].i + temp.i * a[
9330
temp.r = z__1.r, temp.i = z__1.i;
9332
for (i__ = j - 1; i__ >= 1; --i__) {
9334
i__1 = i__ + j * a_dim1;
9336
z__2.r = a[i__1].r * x[i__2].r - a[i__1].i * x[
9337
i__2].i, z__2.i = a[i__1].r * x[i__2].i +
9338
a[i__1].i * x[i__2].r;
9339
z__1.r = temp.r + z__2.r, z__1.i = temp.i +
9341
temp.r = z__1.r, temp.i = z__1.i;
9346
d_cnjg(&z__2, &a[j + j * a_dim1]);
9347
z__1.r = temp.r * z__2.r - temp.i * z__2.i,
9348
z__1.i = temp.r * z__2.i + temp.i *
9350
temp.r = z__1.r, temp.i = z__1.i;
9352
for (i__ = j - 1; i__ >= 1; --i__) {
9354
d_cnjg(&z__3, &a[i__ + j * a_dim1]);
9356
z__2.r = z__3.r * x[i__1].r - z__3.i * x[i__1].i,
9357
z__2.i = z__3.r * x[i__1].i + z__3.i * x[
9359
z__1.r = temp.r + z__2.r, z__1.i = temp.i +
9361
temp.r = z__1.r, temp.i = z__1.i;
9366
x[i__1].r = temp.r, x[i__1].i = temp.i;
9374
for (j = 1; j <= i__1; ++j) {
9376
temp.r = x[i__2].r, temp.i = x[i__2].i;
9379
i__2 = j + j * a_dim1;
9380
z__1.r = temp.r * a[i__2].r - temp.i * a[i__2].i,
9381
z__1.i = temp.r * a[i__2].i + temp.i * a[
9383
temp.r = z__1.r, temp.i = z__1.i;
9386
for (i__ = j + 1; i__ <= i__2; ++i__) {
9387
i__3 = i__ + j * a_dim1;
9389
z__2.r = a[i__3].r * x[i__4].r - a[i__3].i * x[
9390
i__4].i, z__2.i = a[i__3].r * x[i__4].i +
9391
a[i__3].i * x[i__4].r;
9392
z__1.r = temp.r + z__2.r, z__1.i = temp.i +
9394
temp.r = z__1.r, temp.i = z__1.i;
9399
d_cnjg(&z__2, &a[j + j * a_dim1]);
9400
z__1.r = temp.r * z__2.r - temp.i * z__2.i,
9401
z__1.i = temp.r * z__2.i + temp.i *
9403
temp.r = z__1.r, temp.i = z__1.i;
9406
for (i__ = j + 1; i__ <= i__2; ++i__) {
9407
d_cnjg(&z__3, &a[i__ + j * a_dim1]);
9409
z__2.r = z__3.r * x[i__3].r - z__3.i * x[i__3].i,
9410
z__2.i = z__3.r * x[i__3].i + z__3.i * x[
9412
z__1.r = temp.r + z__2.r, z__1.i = temp.i +
9414
temp.r = z__1.r, temp.i = z__1.i;
9419
x[i__2].r = temp.r, x[i__2].i = temp.i;
9425
for (j = 1; j <= i__1; ++j) {
9427
temp.r = x[i__2].r, temp.i = x[i__2].i;
9431
i__2 = j + j * a_dim1;
9432
z__1.r = temp.r * a[i__2].r - temp.i * a[i__2].i,
9433
z__1.i = temp.r * a[i__2].i + temp.i * a[
9435
temp.r = z__1.r, temp.i = z__1.i;
9438
for (i__ = j + 1; i__ <= i__2; ++i__) {
9440
i__3 = i__ + j * a_dim1;
9442
z__2.r = a[i__3].r * x[i__4].r - a[i__3].i * x[
9443
i__4].i, z__2.i = a[i__3].r * x[i__4].i +
9444
a[i__3].i * x[i__4].r;
9445
z__1.r = temp.r + z__2.r, z__1.i = temp.i +
9447
temp.r = z__1.r, temp.i = z__1.i;
9452
d_cnjg(&z__2, &a[j + j * a_dim1]);
9453
z__1.r = temp.r * z__2.r - temp.i * z__2.i,
9454
z__1.i = temp.r * z__2.i + temp.i *
9456
temp.r = z__1.r, temp.i = z__1.i;
9459
for (i__ = j + 1; i__ <= i__2; ++i__) {
9461
d_cnjg(&z__3, &a[i__ + j * a_dim1]);
9463
z__2.r = z__3.r * x[i__3].r - z__3.i * x[i__3].i,
9464
z__2.i = z__3.r * x[i__3].i + z__3.i * x[
9466
z__1.r = temp.r + z__2.r, z__1.i = temp.i +
9468
temp.r = z__1.r, temp.i = z__1.i;
9473
x[i__2].r = temp.r, x[i__2].i = temp.i;
9483
/* End of ZTRMV . */
9487
/* Subroutine */ int ztrsm_(char *side, char *uplo, char *transa, char *diag,
9488
integer *m, integer *n, doublecomplex *alpha, doublecomplex *a,
9489
integer *lda, doublecomplex *b, integer *ldb)
9491
/* System generated locals */
9492
integer a_dim1, a_offset, b_dim1, b_offset, i__1, i__2, i__3, i__4, i__5,
9494
doublecomplex z__1, z__2, z__3;
9496
/* Builtin functions */
9497
void z_div(doublecomplex *, doublecomplex *, doublecomplex *), d_cnjg(
9498
doublecomplex *, doublecomplex *);
9500
/* Local variables */
9501
static integer i__, j, k, info;
9502
static doublecomplex temp;
9503
static logical lside;
9504
extern logical lsame_(char *, char *);
9505
static integer nrowa;
9506
static logical upper;
9507
extern /* Subroutine */ int xerbla_(char *, integer *);
9508
static logical noconj, nounit;
9515
ZTRSM solves one of the matrix equations
9517
op( A )*X = alpha*B, or X*op( A ) = alpha*B,
9519
where alpha is a scalar, X and B are m by n matrices, A is a unit, or
9520
non-unit, upper or lower triangular matrix and op( A ) is one of
9522
op( A ) = A or op( A ) = A' or op( A ) = conjg( A' ).
9524
The matrix X is overwritten on B.
9530
On entry, SIDE specifies whether op( A ) appears on the left
9531
or right of X as follows:
9533
SIDE = 'L' or 'l' op( A )*X = alpha*B.
9535
SIDE = 'R' or 'r' X*op( A ) = alpha*B.
9540
On entry, UPLO specifies whether the matrix A is an upper or
9541
lower triangular matrix as follows:
9543
UPLO = 'U' or 'u' A is an upper triangular matrix.
9545
UPLO = 'L' or 'l' A is a lower triangular matrix.
9549
TRANSA - CHARACTER*1.
9550
On entry, TRANSA specifies the form of op( A ) to be used in
9551
the matrix multiplication as follows:
9553
TRANSA = 'N' or 'n' op( A ) = A.
9555
TRANSA = 'T' or 't' op( A ) = A'.
9557
TRANSA = 'C' or 'c' op( A ) = conjg( A' ).
9562
On entry, DIAG specifies whether or not A is unit triangular
9565
DIAG = 'U' or 'u' A is assumed to be unit triangular.
9567
DIAG = 'N' or 'n' A is not assumed to be unit
9573
On entry, M specifies the number of rows of B. M must be at
9578
On entry, N specifies the number of columns of B. N must be
9582
ALPHA - COMPLEX*16 .
9583
On entry, ALPHA specifies the scalar alpha. When alpha is
9584
zero then A is not referenced and B need not be set before
9588
A - COMPLEX*16 array of DIMENSION ( LDA, k ), where k is m
9589
when SIDE = 'L' or 'l' and is n when SIDE = 'R' or 'r'.
9590
Before entry with UPLO = 'U' or 'u', the leading k by k
9591
upper triangular part of the array A must contain the upper
9592
triangular matrix and the strictly lower triangular part of
9593
A is not referenced.
9594
Before entry with UPLO = 'L' or 'l', the leading k by k
9595
lower triangular part of the array A must contain the lower
9596
triangular matrix and the strictly upper triangular part of
9597
A is not referenced.
9598
Note that when DIAG = 'U' or 'u', the diagonal elements of
9599
A are not referenced either, but are assumed to be unity.
9603
On entry, LDA specifies the first dimension of A as declared
9604
in the calling (sub) program. When SIDE = 'L' or 'l' then
9605
LDA must be at least max( 1, m ), when SIDE = 'R' or 'r'
9606
then LDA must be at least max( 1, n ).
9609
B - COMPLEX*16 array of DIMENSION ( LDB, n ).
9610
Before entry, the leading m by n part of the array B must
9611
contain the right-hand side matrix B, and on exit is
9612
overwritten by the solution matrix X.
9615
On entry, LDB specifies the first dimension of B as declared
9616
in the calling (sub) program. LDB must be at least
9621
Level 3 Blas routine.
9623
-- Written on 8-February-1989.
9624
Jack Dongarra, Argonne National Laboratory.
9625
Iain Duff, AERE Harwell.
9626
Jeremy Du Croz, Numerical Algorithms Group Ltd.
9627
Sven Hammarling, Numerical Algorithms Group Ltd.
9630
Test the input parameters.
9633
/* Parameter adjustments */
9635
a_offset = 1 + a_dim1 * 1;
9638
b_offset = 1 + b_dim1 * 1;
9642
lside = lsame_(side, "L");
9648
noconj = lsame_(transa, "T");
9649
nounit = lsame_(diag, "N");
9650
upper = lsame_(uplo, "U");
9653
if ((! lside && ! lsame_(side, "R"))) {
9655
} else if ((! upper && ! lsame_(uplo, "L"))) {
9657
} else if (((! lsame_(transa, "N") && ! lsame_(
9658
transa, "T")) && ! lsame_(transa, "C"))) {
9660
} else if ((! lsame_(diag, "U") && ! lsame_(diag,
9663
} else if (*m < 0) {
9665
} else if (*n < 0) {
9667
} else if (*lda < max(1,nrowa)) {
9669
} else if (*ldb < max(1,*m)) {
9673
xerbla_("ZTRSM ", &info);
9677
/* Quick return if possible. */
9683
/* And when alpha.eq.zero. */
9685
if ((alpha->r == 0. && alpha->i == 0.)) {
9687
for (j = 1; j <= i__1; ++j) {
9689
for (i__ = 1; i__ <= i__2; ++i__) {
9690
i__3 = i__ + j * b_dim1;
9691
b[i__3].r = 0., b[i__3].i = 0.;
9699
/* Start the operations. */
9702
if (lsame_(transa, "N")) {
9704
/* Form B := alpha*inv( A )*B. */
9708
for (j = 1; j <= i__1; ++j) {
9709
if (alpha->r != 1. || alpha->i != 0.) {
9711
for (i__ = 1; i__ <= i__2; ++i__) {
9712
i__3 = i__ + j * b_dim1;
9713
i__4 = i__ + j * b_dim1;
9714
z__1.r = alpha->r * b[i__4].r - alpha->i * b[i__4]
9715
.i, z__1.i = alpha->r * b[i__4].i +
9716
alpha->i * b[i__4].r;
9717
b[i__3].r = z__1.r, b[i__3].i = z__1.i;
9721
for (k = *m; k >= 1; --k) {
9722
i__2 = k + j * b_dim1;
9723
if (b[i__2].r != 0. || b[i__2].i != 0.) {
9725
i__2 = k + j * b_dim1;
9726
z_div(&z__1, &b[k + j * b_dim1], &a[k + k *
9728
b[i__2].r = z__1.r, b[i__2].i = z__1.i;
9731
for (i__ = 1; i__ <= i__2; ++i__) {
9732
i__3 = i__ + j * b_dim1;
9733
i__4 = i__ + j * b_dim1;
9734
i__5 = k + j * b_dim1;
9735
i__6 = i__ + k * a_dim1;
9736
z__2.r = b[i__5].r * a[i__6].r - b[i__5].i *
9737
a[i__6].i, z__2.i = b[i__5].r * a[
9738
i__6].i + b[i__5].i * a[i__6].r;
9739
z__1.r = b[i__4].r - z__2.r, z__1.i = b[i__4]
9741
b[i__3].r = z__1.r, b[i__3].i = z__1.i;
9751
for (j = 1; j <= i__1; ++j) {
9752
if (alpha->r != 1. || alpha->i != 0.) {
9754
for (i__ = 1; i__ <= i__2; ++i__) {
9755
i__3 = i__ + j * b_dim1;
9756
i__4 = i__ + j * b_dim1;
9757
z__1.r = alpha->r * b[i__4].r - alpha->i * b[i__4]
9758
.i, z__1.i = alpha->r * b[i__4].i +
9759
alpha->i * b[i__4].r;
9760
b[i__3].r = z__1.r, b[i__3].i = z__1.i;
9765
for (k = 1; k <= i__2; ++k) {
9766
i__3 = k + j * b_dim1;
9767
if (b[i__3].r != 0. || b[i__3].i != 0.) {
9769
i__3 = k + j * b_dim1;
9770
z_div(&z__1, &b[k + j * b_dim1], &a[k + k *
9772
b[i__3].r = z__1.r, b[i__3].i = z__1.i;
9775
for (i__ = k + 1; i__ <= i__3; ++i__) {
9776
i__4 = i__ + j * b_dim1;
9777
i__5 = i__ + j * b_dim1;
9778
i__6 = k + j * b_dim1;
9779
i__7 = i__ + k * a_dim1;
9780
z__2.r = b[i__6].r * a[i__7].r - b[i__6].i *
9781
a[i__7].i, z__2.i = b[i__6].r * a[
9782
i__7].i + b[i__6].i * a[i__7].r;
9783
z__1.r = b[i__5].r - z__2.r, z__1.i = b[i__5]
9785
b[i__4].r = z__1.r, b[i__4].i = z__1.i;
9797
Form B := alpha*inv( A' )*B
9798
or B := alpha*inv( conjg( A' ) )*B.
9803
for (j = 1; j <= i__1; ++j) {
9805
for (i__ = 1; i__ <= i__2; ++i__) {
9806
i__3 = i__ + j * b_dim1;
9807
z__1.r = alpha->r * b[i__3].r - alpha->i * b[i__3].i,
9808
z__1.i = alpha->r * b[i__3].i + alpha->i * b[
9810
temp.r = z__1.r, temp.i = z__1.i;
9813
for (k = 1; k <= i__3; ++k) {
9814
i__4 = k + i__ * a_dim1;
9815
i__5 = k + j * b_dim1;
9816
z__2.r = a[i__4].r * b[i__5].r - a[i__4].i *
9817
b[i__5].i, z__2.i = a[i__4].r * b[
9818
i__5].i + a[i__4].i * b[i__5].r;
9819
z__1.r = temp.r - z__2.r, z__1.i = temp.i -
9821
temp.r = z__1.r, temp.i = z__1.i;
9825
z_div(&z__1, &temp, &a[i__ + i__ * a_dim1]);
9826
temp.r = z__1.r, temp.i = z__1.i;
9830
for (k = 1; k <= i__3; ++k) {
9831
d_cnjg(&z__3, &a[k + i__ * a_dim1]);
9832
i__4 = k + j * b_dim1;
9833
z__2.r = z__3.r * b[i__4].r - z__3.i * b[i__4]
9834
.i, z__2.i = z__3.r * b[i__4].i +
9836
z__1.r = temp.r - z__2.r, z__1.i = temp.i -
9838
temp.r = z__1.r, temp.i = z__1.i;
9842
d_cnjg(&z__2, &a[i__ + i__ * a_dim1]);
9843
z_div(&z__1, &temp, &z__2);
9844
temp.r = z__1.r, temp.i = z__1.i;
9847
i__3 = i__ + j * b_dim1;
9848
b[i__3].r = temp.r, b[i__3].i = temp.i;
9855
for (j = 1; j <= i__1; ++j) {
9856
for (i__ = *m; i__ >= 1; --i__) {
9857
i__2 = i__ + j * b_dim1;
9858
z__1.r = alpha->r * b[i__2].r - alpha->i * b[i__2].i,
9859
z__1.i = alpha->r * b[i__2].i + alpha->i * b[
9861
temp.r = z__1.r, temp.i = z__1.i;
9864
for (k = i__ + 1; k <= i__2; ++k) {
9865
i__3 = k + i__ * a_dim1;
9866
i__4 = k + j * b_dim1;
9867
z__2.r = a[i__3].r * b[i__4].r - a[i__3].i *
9868
b[i__4].i, z__2.i = a[i__3].r * b[
9869
i__4].i + a[i__3].i * b[i__4].r;
9870
z__1.r = temp.r - z__2.r, z__1.i = temp.i -
9872
temp.r = z__1.r, temp.i = z__1.i;
9876
z_div(&z__1, &temp, &a[i__ + i__ * a_dim1]);
9877
temp.r = z__1.r, temp.i = z__1.i;
9881
for (k = i__ + 1; k <= i__2; ++k) {
9882
d_cnjg(&z__3, &a[k + i__ * a_dim1]);
9883
i__3 = k + j * b_dim1;
9884
z__2.r = z__3.r * b[i__3].r - z__3.i * b[i__3]
9885
.i, z__2.i = z__3.r * b[i__3].i +
9887
z__1.r = temp.r - z__2.r, z__1.i = temp.i -
9889
temp.r = z__1.r, temp.i = z__1.i;
9893
d_cnjg(&z__2, &a[i__ + i__ * a_dim1]);
9894
z_div(&z__1, &temp, &z__2);
9895
temp.r = z__1.r, temp.i = z__1.i;
9898
i__2 = i__ + j * b_dim1;
9899
b[i__2].r = temp.r, b[i__2].i = temp.i;
9907
if (lsame_(transa, "N")) {
9909
/* Form B := alpha*B*inv( A ). */
9913
for (j = 1; j <= i__1; ++j) {
9914
if (alpha->r != 1. || alpha->i != 0.) {
9916
for (i__ = 1; i__ <= i__2; ++i__) {
9917
i__3 = i__ + j * b_dim1;
9918
i__4 = i__ + j * b_dim1;
9919
z__1.r = alpha->r * b[i__4].r - alpha->i * b[i__4]
9920
.i, z__1.i = alpha->r * b[i__4].i +
9921
alpha->i * b[i__4].r;
9922
b[i__3].r = z__1.r, b[i__3].i = z__1.i;
9927
for (k = 1; k <= i__2; ++k) {
9928
i__3 = k + j * a_dim1;
9929
if (a[i__3].r != 0. || a[i__3].i != 0.) {
9931
for (i__ = 1; i__ <= i__3; ++i__) {
9932
i__4 = i__ + j * b_dim1;
9933
i__5 = i__ + j * b_dim1;
9934
i__6 = k + j * a_dim1;
9935
i__7 = i__ + k * b_dim1;
9936
z__2.r = a[i__6].r * b[i__7].r - a[i__6].i *
9937
b[i__7].i, z__2.i = a[i__6].r * b[
9938
i__7].i + a[i__6].i * b[i__7].r;
9939
z__1.r = b[i__5].r - z__2.r, z__1.i = b[i__5]
9941
b[i__4].r = z__1.r, b[i__4].i = z__1.i;
9948
z_div(&z__1, &c_b359, &a[j + j * a_dim1]);
9949
temp.r = z__1.r, temp.i = z__1.i;
9951
for (i__ = 1; i__ <= i__2; ++i__) {
9952
i__3 = i__ + j * b_dim1;
9953
i__4 = i__ + j * b_dim1;
9954
z__1.r = temp.r * b[i__4].r - temp.i * b[i__4].i,
9955
z__1.i = temp.r * b[i__4].i + temp.i * b[
9957
b[i__3].r = z__1.r, b[i__3].i = z__1.i;
9964
for (j = *n; j >= 1; --j) {
9965
if (alpha->r != 1. || alpha->i != 0.) {
9967
for (i__ = 1; i__ <= i__1; ++i__) {
9968
i__2 = i__ + j * b_dim1;
9969
i__3 = i__ + j * b_dim1;
9970
z__1.r = alpha->r * b[i__3].r - alpha->i * b[i__3]
9971
.i, z__1.i = alpha->r * b[i__3].i +
9972
alpha->i * b[i__3].r;
9973
b[i__2].r = z__1.r, b[i__2].i = z__1.i;
9978
for (k = j + 1; k <= i__1; ++k) {
9979
i__2 = k + j * a_dim1;
9980
if (a[i__2].r != 0. || a[i__2].i != 0.) {
9982
for (i__ = 1; i__ <= i__2; ++i__) {
9983
i__3 = i__ + j * b_dim1;
9984
i__4 = i__ + j * b_dim1;
9985
i__5 = k + j * a_dim1;
9986
i__6 = i__ + k * b_dim1;
9987
z__2.r = a[i__5].r * b[i__6].r - a[i__5].i *
9988
b[i__6].i, z__2.i = a[i__5].r * b[
9989
i__6].i + a[i__5].i * b[i__6].r;
9990
z__1.r = b[i__4].r - z__2.r, z__1.i = b[i__4]
9992
b[i__3].r = z__1.r, b[i__3].i = z__1.i;
9999
z_div(&z__1, &c_b359, &a[j + j * a_dim1]);
10000
temp.r = z__1.r, temp.i = z__1.i;
10002
for (i__ = 1; i__ <= i__1; ++i__) {
10003
i__2 = i__ + j * b_dim1;
10004
i__3 = i__ + j * b_dim1;
10005
z__1.r = temp.r * b[i__3].r - temp.i * b[i__3].i,
10006
z__1.i = temp.r * b[i__3].i + temp.i * b[
10008
b[i__2].r = z__1.r, b[i__2].i = z__1.i;
10018
Form B := alpha*B*inv( A' )
10019
or B := alpha*B*inv( conjg( A' ) ).
10023
for (k = *n; k >= 1; --k) {
10026
z_div(&z__1, &c_b359, &a[k + k * a_dim1]);
10027
temp.r = z__1.r, temp.i = z__1.i;
10029
d_cnjg(&z__2, &a[k + k * a_dim1]);
10030
z_div(&z__1, &c_b359, &z__2);
10031
temp.r = z__1.r, temp.i = z__1.i;
10034
for (i__ = 1; i__ <= i__1; ++i__) {
10035
i__2 = i__ + k * b_dim1;
10036
i__3 = i__ + k * b_dim1;
10037
z__1.r = temp.r * b[i__3].r - temp.i * b[i__3].i,
10038
z__1.i = temp.r * b[i__3].i + temp.i * b[
10040
b[i__2].r = z__1.r, b[i__2].i = z__1.i;
10045
for (j = 1; j <= i__1; ++j) {
10046
i__2 = j + k * a_dim1;
10047
if (a[i__2].r != 0. || a[i__2].i != 0.) {
10049
i__2 = j + k * a_dim1;
10050
temp.r = a[i__2].r, temp.i = a[i__2].i;
10052
d_cnjg(&z__1, &a[j + k * a_dim1]);
10053
temp.r = z__1.r, temp.i = z__1.i;
10056
for (i__ = 1; i__ <= i__2; ++i__) {
10057
i__3 = i__ + j * b_dim1;
10058
i__4 = i__ + j * b_dim1;
10059
i__5 = i__ + k * b_dim1;
10060
z__2.r = temp.r * b[i__5].r - temp.i * b[i__5]
10061
.i, z__2.i = temp.r * b[i__5].i +
10062
temp.i * b[i__5].r;
10063
z__1.r = b[i__4].r - z__2.r, z__1.i = b[i__4]
10065
b[i__3].r = z__1.r, b[i__3].i = z__1.i;
10071
if (alpha->r != 1. || alpha->i != 0.) {
10073
for (i__ = 1; i__ <= i__1; ++i__) {
10074
i__2 = i__ + k * b_dim1;
10075
i__3 = i__ + k * b_dim1;
10076
z__1.r = alpha->r * b[i__3].r - alpha->i * b[i__3]
10077
.i, z__1.i = alpha->r * b[i__3].i +
10078
alpha->i * b[i__3].r;
10079
b[i__2].r = z__1.r, b[i__2].i = z__1.i;
10087
for (k = 1; k <= i__1; ++k) {
10090
z_div(&z__1, &c_b359, &a[k + k * a_dim1]);
10091
temp.r = z__1.r, temp.i = z__1.i;
10093
d_cnjg(&z__2, &a[k + k * a_dim1]);
10094
z_div(&z__1, &c_b359, &z__2);
10095
temp.r = z__1.r, temp.i = z__1.i;
10098
for (i__ = 1; i__ <= i__2; ++i__) {
10099
i__3 = i__ + k * b_dim1;
10100
i__4 = i__ + k * b_dim1;
10101
z__1.r = temp.r * b[i__4].r - temp.i * b[i__4].i,
10102
z__1.i = temp.r * b[i__4].i + temp.i * b[
10104
b[i__3].r = z__1.r, b[i__3].i = z__1.i;
10109
for (j = k + 1; j <= i__2; ++j) {
10110
i__3 = j + k * a_dim1;
10111
if (a[i__3].r != 0. || a[i__3].i != 0.) {
10113
i__3 = j + k * a_dim1;
10114
temp.r = a[i__3].r, temp.i = a[i__3].i;
10116
d_cnjg(&z__1, &a[j + k * a_dim1]);
10117
temp.r = z__1.r, temp.i = z__1.i;
10120
for (i__ = 1; i__ <= i__3; ++i__) {
10121
i__4 = i__ + j * b_dim1;
10122
i__5 = i__ + j * b_dim1;
10123
i__6 = i__ + k * b_dim1;
10124
z__2.r = temp.r * b[i__6].r - temp.i * b[i__6]
10125
.i, z__2.i = temp.r * b[i__6].i +
10126
temp.i * b[i__6].r;
10127
z__1.r = b[i__5].r - z__2.r, z__1.i = b[i__5]
10129
b[i__4].r = z__1.r, b[i__4].i = z__1.i;
10135
if (alpha->r != 1. || alpha->i != 0.) {
10137
for (i__ = 1; i__ <= i__2; ++i__) {
10138
i__3 = i__ + k * b_dim1;
10139
i__4 = i__ + k * b_dim1;
10140
z__1.r = alpha->r * b[i__4].r - alpha->i * b[i__4]
10141
.i, z__1.i = alpha->r * b[i__4].i +
10142
alpha->i * b[i__4].r;
10143
b[i__3].r = z__1.r, b[i__3].i = z__1.i;
10155
/* End of ZTRSM . */
10159
/* Subroutine */ int ztrsv_(char *uplo, char *trans, char *diag, integer *n,
10160
doublecomplex *a, integer *lda, doublecomplex *x, integer *incx)
10162
/* System generated locals */
10163
integer a_dim1, a_offset, i__1, i__2, i__3, i__4, i__5;
10164
doublecomplex z__1, z__2, z__3;
10166
/* Builtin functions */
10167
void z_div(doublecomplex *, doublecomplex *, doublecomplex *), d_cnjg(
10168
doublecomplex *, doublecomplex *);
10170
/* Local variables */
10171
static integer i__, j, ix, jx, kx, info;
10172
static doublecomplex temp;
10173
extern logical lsame_(char *, char *);
10174
extern /* Subroutine */ int xerbla_(char *, integer *);
10175
static logical noconj, nounit;
10182
ZTRSV solves one of the systems of equations
10184
A*x = b, or A'*x = b, or conjg( A' )*x = b,
10186
where b and x are n element vectors and A is an n by n unit, or
10187
non-unit, upper or lower triangular matrix.
10189
No test for singularity or near-singularity is included in this
10190
routine. Such tests must be performed before calling this routine.
10195
UPLO - CHARACTER*1.
10196
On entry, UPLO specifies whether the matrix is an upper or
10197
lower triangular matrix as follows:
10199
UPLO = 'U' or 'u' A is an upper triangular matrix.
10201
UPLO = 'L' or 'l' A is a lower triangular matrix.
10205
TRANS - CHARACTER*1.
10206
On entry, TRANS specifies the equations to be solved as
10209
TRANS = 'N' or 'n' A*x = b.
10211
TRANS = 'T' or 't' A'*x = b.
10213
TRANS = 'C' or 'c' conjg( A' )*x = b.
10217
DIAG - CHARACTER*1.
10218
On entry, DIAG specifies whether or not A is unit
10219
triangular as follows:
10221
DIAG = 'U' or 'u' A is assumed to be unit triangular.
10223
DIAG = 'N' or 'n' A is not assumed to be unit
10229
On entry, N specifies the order of the matrix A.
10230
N must be at least zero.
10233
A - COMPLEX*16 array of DIMENSION ( LDA, n ).
10234
Before entry with UPLO = 'U' or 'u', the leading n by n
10235
upper triangular part of the array A must contain the upper
10236
triangular matrix and the strictly lower triangular part of
10237
A is not referenced.
10238
Before entry with UPLO = 'L' or 'l', the leading n by n
10239
lower triangular part of the array A must contain the lower
10240
triangular matrix and the strictly upper triangular part of
10241
A is not referenced.
10242
Note that when DIAG = 'U' or 'u', the diagonal elements of
10243
A are not referenced either, but are assumed to be unity.
10247
On entry, LDA specifies the first dimension of A as declared
10248
in the calling (sub) program. LDA must be at least
10252
X - COMPLEX*16 array of dimension at least
10253
( 1 + ( n - 1 )*abs( INCX ) ).
10254
Before entry, the incremented array X must contain the n
10255
element right-hand side vector b. On exit, X is overwritten
10256
with the solution vector x.
10259
On entry, INCX specifies the increment for the elements of
10260
X. INCX must not be zero.
10264
Level 2 Blas routine.
10266
-- Written on 22-October-1986.
10267
Jack Dongarra, Argonne National Lab.
10268
Jeremy Du Croz, Nag Central Office.
10269
Sven Hammarling, Nag Central Office.
10270
Richard Hanson, Sandia National Labs.
10273
Test the input parameters.
10276
/* Parameter adjustments */
10278
a_offset = 1 + a_dim1 * 1;
10282
/* Function Body */
10284
if ((! lsame_(uplo, "U") && ! lsame_(uplo, "L"))) {
10286
} else if (((! lsame_(trans, "N") && ! lsame_(trans,
10287
"T")) && ! lsame_(trans, "C"))) {
10289
} else if ((! lsame_(diag, "U") && ! lsame_(diag,
10292
} else if (*n < 0) {
10294
} else if (*lda < max(1,*n)) {
10296
} else if (*incx == 0) {
10300
xerbla_("ZTRSV ", &info);
10304
/* Quick return if possible. */
10310
noconj = lsame_(trans, "T");
10311
nounit = lsame_(diag, "N");
10314
Set up the start point in X if the increment is not unity. This
10315
will be ( N - 1 )*INCX too small for descending loops.
10319
kx = 1 - (*n - 1) * *incx;
10320
} else if (*incx != 1) {
10325
Start the operations. In this version the elements of A are
10326
accessed sequentially with one pass through A.
10329
if (lsame_(trans, "N")) {
10331
/* Form x := inv( A )*x. */
10333
if (lsame_(uplo, "U")) {
10335
for (j = *n; j >= 1; --j) {
10337
if (x[i__1].r != 0. || x[i__1].i != 0.) {
10340
z_div(&z__1, &x[j], &a[j + j * a_dim1]);
10341
x[i__1].r = z__1.r, x[i__1].i = z__1.i;
10344
temp.r = x[i__1].r, temp.i = x[i__1].i;
10345
for (i__ = j - 1; i__ >= 1; --i__) {
10348
i__3 = i__ + j * a_dim1;
10349
z__2.r = temp.r * a[i__3].r - temp.i * a[i__3].i,
10350
z__2.i = temp.r * a[i__3].i + temp.i * a[
10352
z__1.r = x[i__2].r - z__2.r, z__1.i = x[i__2].i -
10354
x[i__1].r = z__1.r, x[i__1].i = z__1.i;
10361
jx = kx + (*n - 1) * *incx;
10362
for (j = *n; j >= 1; --j) {
10364
if (x[i__1].r != 0. || x[i__1].i != 0.) {
10367
z_div(&z__1, &x[jx], &a[j + j * a_dim1]);
10368
x[i__1].r = z__1.r, x[i__1].i = z__1.i;
10371
temp.r = x[i__1].r, temp.i = x[i__1].i;
10373
for (i__ = j - 1; i__ >= 1; --i__) {
10377
i__3 = i__ + j * a_dim1;
10378
z__2.r = temp.r * a[i__3].r - temp.i * a[i__3].i,
10379
z__2.i = temp.r * a[i__3].i + temp.i * a[
10381
z__1.r = x[i__2].r - z__2.r, z__1.i = x[i__2].i -
10383
x[i__1].r = z__1.r, x[i__1].i = z__1.i;
10394
for (j = 1; j <= i__1; ++j) {
10396
if (x[i__2].r != 0. || x[i__2].i != 0.) {
10399
z_div(&z__1, &x[j], &a[j + j * a_dim1]);
10400
x[i__2].r = z__1.r, x[i__2].i = z__1.i;
10403
temp.r = x[i__2].r, temp.i = x[i__2].i;
10405
for (i__ = j + 1; i__ <= i__2; ++i__) {
10408
i__5 = i__ + j * a_dim1;
10409
z__2.r = temp.r * a[i__5].r - temp.i * a[i__5].i,
10410
z__2.i = temp.r * a[i__5].i + temp.i * a[
10412
z__1.r = x[i__4].r - z__2.r, z__1.i = x[i__4].i -
10414
x[i__3].r = z__1.r, x[i__3].i = z__1.i;
10423
for (j = 1; j <= i__1; ++j) {
10425
if (x[i__2].r != 0. || x[i__2].i != 0.) {
10428
z_div(&z__1, &x[jx], &a[j + j * a_dim1]);
10429
x[i__2].r = z__1.r, x[i__2].i = z__1.i;
10432
temp.r = x[i__2].r, temp.i = x[i__2].i;
10435
for (i__ = j + 1; i__ <= i__2; ++i__) {
10439
i__5 = i__ + j * a_dim1;
10440
z__2.r = temp.r * a[i__5].r - temp.i * a[i__5].i,
10441
z__2.i = temp.r * a[i__5].i + temp.i * a[
10443
z__1.r = x[i__4].r - z__2.r, z__1.i = x[i__4].i -
10445
x[i__3].r = z__1.r, x[i__3].i = z__1.i;
10456
/* Form x := inv( A' )*x or x := inv( conjg( A' ) )*x. */
10458
if (lsame_(uplo, "U")) {
10461
for (j = 1; j <= i__1; ++j) {
10463
temp.r = x[i__2].r, temp.i = x[i__2].i;
10466
for (i__ = 1; i__ <= i__2; ++i__) {
10467
i__3 = i__ + j * a_dim1;
10469
z__2.r = a[i__3].r * x[i__4].r - a[i__3].i * x[
10470
i__4].i, z__2.i = a[i__3].r * x[i__4].i +
10471
a[i__3].i * x[i__4].r;
10472
z__1.r = temp.r - z__2.r, z__1.i = temp.i -
10474
temp.r = z__1.r, temp.i = z__1.i;
10478
z_div(&z__1, &temp, &a[j + j * a_dim1]);
10479
temp.r = z__1.r, temp.i = z__1.i;
10483
for (i__ = 1; i__ <= i__2; ++i__) {
10484
d_cnjg(&z__3, &a[i__ + j * a_dim1]);
10486
z__2.r = z__3.r * x[i__3].r - z__3.i * x[i__3].i,
10487
z__2.i = z__3.r * x[i__3].i + z__3.i * x[
10489
z__1.r = temp.r - z__2.r, z__1.i = temp.i -
10491
temp.r = z__1.r, temp.i = z__1.i;
10495
d_cnjg(&z__2, &a[j + j * a_dim1]);
10496
z_div(&z__1, &temp, &z__2);
10497
temp.r = z__1.r, temp.i = z__1.i;
10501
x[i__2].r = temp.r, x[i__2].i = temp.i;
10507
for (j = 1; j <= i__1; ++j) {
10510
temp.r = x[i__2].r, temp.i = x[i__2].i;
10513
for (i__ = 1; i__ <= i__2; ++i__) {
10514
i__3 = i__ + j * a_dim1;
10516
z__2.r = a[i__3].r * x[i__4].r - a[i__3].i * x[
10517
i__4].i, z__2.i = a[i__3].r * x[i__4].i +
10518
a[i__3].i * x[i__4].r;
10519
z__1.r = temp.r - z__2.r, z__1.i = temp.i -
10521
temp.r = z__1.r, temp.i = z__1.i;
10526
z_div(&z__1, &temp, &a[j + j * a_dim1]);
10527
temp.r = z__1.r, temp.i = z__1.i;
10531
for (i__ = 1; i__ <= i__2; ++i__) {
10532
d_cnjg(&z__3, &a[i__ + j * a_dim1]);
10534
z__2.r = z__3.r * x[i__3].r - z__3.i * x[i__3].i,
10535
z__2.i = z__3.r * x[i__3].i + z__3.i * x[
10537
z__1.r = temp.r - z__2.r, z__1.i = temp.i -
10539
temp.r = z__1.r, temp.i = z__1.i;
10544
d_cnjg(&z__2, &a[j + j * a_dim1]);
10545
z_div(&z__1, &temp, &z__2);
10546
temp.r = z__1.r, temp.i = z__1.i;
10550
x[i__2].r = temp.r, x[i__2].i = temp.i;
10557
for (j = *n; j >= 1; --j) {
10559
temp.r = x[i__1].r, temp.i = x[i__1].i;
10562
for (i__ = *n; i__ >= i__1; --i__) {
10563
i__2 = i__ + j * a_dim1;
10565
z__2.r = a[i__2].r * x[i__3].r - a[i__2].i * x[
10566
i__3].i, z__2.i = a[i__2].r * x[i__3].i +
10567
a[i__2].i * x[i__3].r;
10568
z__1.r = temp.r - z__2.r, z__1.i = temp.i -
10570
temp.r = z__1.r, temp.i = z__1.i;
10574
z_div(&z__1, &temp, &a[j + j * a_dim1]);
10575
temp.r = z__1.r, temp.i = z__1.i;
10579
for (i__ = *n; i__ >= i__1; --i__) {
10580
d_cnjg(&z__3, &a[i__ + j * a_dim1]);
10582
z__2.r = z__3.r * x[i__2].r - z__3.i * x[i__2].i,
10583
z__2.i = z__3.r * x[i__2].i + z__3.i * x[
10585
z__1.r = temp.r - z__2.r, z__1.i = temp.i -
10587
temp.r = z__1.r, temp.i = z__1.i;
10591
d_cnjg(&z__2, &a[j + j * a_dim1]);
10592
z_div(&z__1, &temp, &z__2);
10593
temp.r = z__1.r, temp.i = z__1.i;
10597
x[i__1].r = temp.r, x[i__1].i = temp.i;
10601
kx += (*n - 1) * *incx;
10603
for (j = *n; j >= 1; --j) {
10606
temp.r = x[i__1].r, temp.i = x[i__1].i;
10609
for (i__ = *n; i__ >= i__1; --i__) {
10610
i__2 = i__ + j * a_dim1;
10612
z__2.r = a[i__2].r * x[i__3].r - a[i__2].i * x[
10613
i__3].i, z__2.i = a[i__2].r * x[i__3].i +
10614
a[i__2].i * x[i__3].r;
10615
z__1.r = temp.r - z__2.r, z__1.i = temp.i -
10617
temp.r = z__1.r, temp.i = z__1.i;
10622
z_div(&z__1, &temp, &a[j + j * a_dim1]);
10623
temp.r = z__1.r, temp.i = z__1.i;
10627
for (i__ = *n; i__ >= i__1; --i__) {
10628
d_cnjg(&z__3, &a[i__ + j * a_dim1]);
10630
z__2.r = z__3.r * x[i__2].r - z__3.i * x[i__2].i,
10631
z__2.i = z__3.r * x[i__2].i + z__3.i * x[
10633
z__1.r = temp.r - z__2.r, z__1.i = temp.i -
10635
temp.r = z__1.r, temp.i = z__1.i;
10640
d_cnjg(&z__2, &a[j + j * a_dim1]);
10641
z_div(&z__1, &temp, &z__2);
10642
temp.r = z__1.r, temp.i = z__1.i;
10646
x[i__1].r = temp.r, x[i__1].i = temp.i;
10656
/* End of ZTRSV . */