2 NOTE: This is generated code. Look in README.python for information on
5 #include "sphinxbase/f2c.h"
10 extern doublereal slamch_(char *);
11 #define EPSILON slamch_("Epsilon")
12 #define SAFEMINIMUM slamch_("Safe minimum")
13 #define PRECISION slamch_("Precision")
14 #define BASE slamch_("Base")
18 extern doublereal slapy2_(real *, real *);
22 /* Table of constant values */
24 static integer c__1 = 1;
26 logical lsame_(char *ca, char *cb)
28 /* System generated locals */
32 static integer inta, intb, zcode;
36 -- LAPACK auxiliary routine (version 3.0) --
37 Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,
38 Courant Institute, Argonne National Lab, and Rice University
45 LSAME returns .TRUE. if CA is the same letter as CB regardless of
51 CA (input) CHARACTER*1
52 CB (input) CHARACTER*1
53 CA and CB specify the single characters to be compared.
55 =====================================================================
58 Test if the characters are equal
61 ret_val = *(unsigned char *)ca == *(unsigned char *)cb;
66 /* Now test for equivalence if both characters are alphabetic. */
71 Use 'Z' rather than 'A' so that ASCII can be detected on Prime
72 machines, on which ICHAR returns a value with bit 8 set.
73 ICHAR('A') on Prime machines returns 193 which is the same as
74 ICHAR('A') on an EBCDIC machine.
77 inta = *(unsigned char *)ca;
78 intb = *(unsigned char *)cb;
80 if (zcode == 90 || zcode == 122) {
83 ASCII is assumed - ZCODE is the ASCII code of either lower or
87 if (inta >= 97 && inta <= 122) {
90 if (intb >= 97 && intb <= 122) {
94 } else if (zcode == 233 || zcode == 169) {
97 EBCDIC is assumed - ZCODE is the EBCDIC code of either lower or
101 if (inta >= 129 && inta <= 137 || inta >= 145 && inta <= 153 || inta
102 >= 162 && inta <= 169) {
105 if (intb >= 129 && intb <= 137 || intb >= 145 && intb <= 153 || intb
106 >= 162 && intb <= 169) {
110 } else if (zcode == 218 || zcode == 250) {
113 ASCII is assumed, on Prime machines - ZCODE is the ASCII code
114 plus 128 of either lower or upper case 'Z'.
117 if (inta >= 225 && inta <= 250) {
120 if (intb >= 225 && intb <= 250) {
124 ret_val = inta == intb;
135 doublereal sdot_(integer *n, real *sx, integer *incx, real *sy, integer *incy)
137 /* System generated locals */
141 /* Local variables */
142 static integer i__, m, ix, iy, mp1;
147 forms the dot product of two vectors.
148 uses unrolled loops for increments equal to one.
149 jack dongarra, linpack, 3/11/78.
150 modified 12/3/93, array(1) declarations changed to array(*)
154 /* Parameter adjustments */
164 if (*incx == 1 && *incy == 1) {
169 code for unequal increments or equal increments
176 ix = (-(*n) + 1) * *incx + 1;
179 iy = (-(*n) + 1) * *incy + 1;
182 for (i__ = 1; i__ <= i__1; ++i__) {
183 stemp += sx[ix] * sy[iy];
192 code for both increments equal to 1
204 for (i__ = 1; i__ <= i__1; ++i__) {
205 stemp += sx[i__] * sy[i__];
214 for (i__ = mp1; i__ <= i__1; i__ += 5) {
215 stemp = stemp + sx[i__] * sy[i__] + sx[i__ + 1] * sy[i__ + 1] + sx[
216 i__ + 2] * sy[i__ + 2] + sx[i__ + 3] * sy[i__ + 3] + sx[i__ +
225 /* Subroutine */ int sgemm_(char *transa, char *transb, integer *m, integer *
226 n, integer *k, real *alpha, real *a, integer *lda, real *b, integer *
227 ldb, real *beta, real *c__, integer *ldc)
229 /* System generated locals */
230 integer a_dim1, a_offset, b_dim1, b_offset, c_dim1, c_offset, i__1, i__2,
233 /* Local variables */
234 static integer i__, j, l, info;
235 static logical nota, notb;
237 static integer ncola;
238 extern logical lsame_(char *, char *);
239 static integer nrowa, nrowb;
240 extern /* Subroutine */ int xerbla_(char *, integer *);
247 SGEMM performs one of the matrix-matrix operations
249 C := alpha*op( A )*op( B ) + beta*C,
251 where op( X ) is one of
253 op( X ) = X or op( X ) = X',
255 alpha and beta are scalars, and A, B and C are matrices, with op( A )
256 an m by k matrix, op( B ) a k by n matrix and C an m by n matrix.
261 TRANSA - CHARACTER*1.
262 On entry, TRANSA specifies the form of op( A ) to be used in
263 the matrix multiplication as follows:
265 TRANSA = 'N' or 'n', op( A ) = A.
267 TRANSA = 'T' or 't', op( A ) = A'.
269 TRANSA = 'C' or 'c', op( A ) = A'.
273 TRANSB - CHARACTER*1.
274 On entry, TRANSB specifies the form of op( B ) to be used in
275 the matrix multiplication as follows:
277 TRANSB = 'N' or 'n', op( B ) = B.
279 TRANSB = 'T' or 't', op( B ) = B'.
281 TRANSB = 'C' or 'c', op( B ) = B'.
286 On entry, M specifies the number of rows of the matrix
287 op( A ) and of the matrix C. M must be at least zero.
291 On entry, N specifies the number of columns of the matrix
292 op( B ) and the number of columns of the matrix C. N must be
297 On entry, K specifies the number of columns of the matrix
298 op( A ) and the number of rows of the matrix op( B ). K must
303 On entry, ALPHA specifies the scalar alpha.
306 A - REAL array of DIMENSION ( LDA, ka ), where ka is
307 k when TRANSA = 'N' or 'n', and is m otherwise.
308 Before entry with TRANSA = 'N' or 'n', the leading m by k
309 part of the array A must contain the matrix A, otherwise
310 the leading k by m part of the array A must contain the
315 On entry, LDA specifies the first dimension of A as declared
316 in the calling (sub) program. When TRANSA = 'N' or 'n' then
317 LDA must be at least max( 1, m ), otherwise LDA must be at
321 B - REAL array of DIMENSION ( LDB, kb ), where kb is
322 n when TRANSB = 'N' or 'n', and is k otherwise.
323 Before entry with TRANSB = 'N' or 'n', the leading k by n
324 part of the array B must contain the matrix B, otherwise
325 the leading n by k part of the array B must contain the
330 On entry, LDB specifies the first dimension of B as declared
331 in the calling (sub) program. When TRANSB = 'N' or 'n' then
332 LDB must be at least max( 1, k ), otherwise LDB must be at
337 On entry, BETA specifies the scalar beta. When BETA is
338 supplied as zero then C need not be set on input.
341 C - REAL array of DIMENSION ( LDC, n ).
342 Before entry, the leading m by n part of the array C must
343 contain the matrix C, except when beta is zero, in which
344 case C need not be set on entry.
345 On exit, the array C is overwritten by the m by n matrix
346 ( alpha*op( A )*op( B ) + beta*C ).
349 On entry, LDC specifies the first dimension of C as declared
350 in the calling (sub) program. LDC must be at least
355 Level 3 Blas routine.
357 -- Written on 8-February-1989.
358 Jack Dongarra, Argonne National Laboratory.
359 Iain Duff, AERE Harwell.
360 Jeremy Du Croz, Numerical Algorithms Group Ltd.
361 Sven Hammarling, Numerical Algorithms Group Ltd.
364 Set NOTA and NOTB as true if A and B respectively are not
365 transposed and set NROWA, NCOLA and NROWB as the number of rows
366 and columns of A and the number of rows of B respectively.
369 /* Parameter adjustments */
371 a_offset = 1 + a_dim1;
374 b_offset = 1 + b_dim1;
377 c_offset = 1 + c_dim1;
381 nota = lsame_(transa, "N");
382 notb = lsame_(transb, "N");
396 /* Test the input parameters. */
399 if (! nota && ! lsame_(transa, "C") && ! lsame_(
402 } else if (! notb && ! lsame_(transb, "C") && !
403 lsame_(transb, "T")) {
411 } else if (*lda < max(1,nrowa)) {
413 } else if (*ldb < max(1,nrowb)) {
415 } else if (*ldc < max(1,*m)) {
419 xerbla_("SGEMM ", &info);
423 /* Quick return if possible. */
425 if (*m == 0 || *n == 0 || (*alpha == 0.f || *k == 0) && *beta == 1.f) {
429 /* And if alpha.eq.zero. */
434 for (j = 1; j <= i__1; ++j) {
436 for (i__ = 1; i__ <= i__2; ++i__) {
437 c__[i__ + j * c_dim1] = 0.f;
444 for (j = 1; j <= i__1; ++j) {
446 for (i__ = 1; i__ <= i__2; ++i__) {
447 c__[i__ + j * c_dim1] = *beta * c__[i__ + j * c_dim1];
456 /* Start the operations. */
461 /* Form C := alpha*A*B + beta*C. */
464 for (j = 1; j <= i__1; ++j) {
467 for (i__ = 1; i__ <= i__2; ++i__) {
468 c__[i__ + j * c_dim1] = 0.f;
471 } else if (*beta != 1.f) {
473 for (i__ = 1; i__ <= i__2; ++i__) {
474 c__[i__ + j * c_dim1] = *beta * c__[i__ + j * c_dim1];
479 for (l = 1; l <= i__2; ++l) {
480 if (b[l + j * b_dim1] != 0.f) {
481 temp = *alpha * b[l + j * b_dim1];
483 for (i__ = 1; i__ <= i__3; ++i__) {
484 c__[i__ + j * c_dim1] += temp * a[i__ + l *
495 /* Form C := alpha*A'*B + beta*C */
498 for (j = 1; j <= i__1; ++j) {
500 for (i__ = 1; i__ <= i__2; ++i__) {
503 for (l = 1; l <= i__3; ++l) {
504 temp += a[l + i__ * a_dim1] * b[l + j * b_dim1];
508 c__[i__ + j * c_dim1] = *alpha * temp;
510 c__[i__ + j * c_dim1] = *alpha * temp + *beta * c__[
521 /* Form C := alpha*A*B' + beta*C */
524 for (j = 1; j <= i__1; ++j) {
527 for (i__ = 1; i__ <= i__2; ++i__) {
528 c__[i__ + j * c_dim1] = 0.f;
531 } else if (*beta != 1.f) {
533 for (i__ = 1; i__ <= i__2; ++i__) {
534 c__[i__ + j * c_dim1] = *beta * c__[i__ + j * c_dim1];
539 for (l = 1; l <= i__2; ++l) {
540 if (b[j + l * b_dim1] != 0.f) {
541 temp = *alpha * b[j + l * b_dim1];
543 for (i__ = 1; i__ <= i__3; ++i__) {
544 c__[i__ + j * c_dim1] += temp * a[i__ + l *
555 /* Form C := alpha*A'*B' + beta*C */
558 for (j = 1; j <= i__1; ++j) {
560 for (i__ = 1; i__ <= i__2; ++i__) {
563 for (l = 1; l <= i__3; ++l) {
564 temp += a[l + i__ * a_dim1] * b[j + l * b_dim1];
568 c__[i__ + j * c_dim1] = *alpha * temp;
570 c__[i__ + j * c_dim1] = *alpha * temp + *beta * c__[
586 /* Subroutine */ int sgemv_(char *trans, integer *m, integer *n, real *alpha,
587 real *a, integer *lda, real *x, integer *incx, real *beta, real *y,
590 /* System generated locals */
591 integer a_dim1, a_offset, i__1, i__2;
593 /* Local variables */
594 static integer i__, j, ix, iy, jx, jy, kx, ky, info;
596 static integer lenx, leny;
597 extern logical lsame_(char *, char *);
598 extern /* Subroutine */ int xerbla_(char *, integer *);
605 SGEMV performs one of the matrix-vector operations
607 y := alpha*A*x + beta*y, or y := alpha*A'*x + beta*y,
609 where alpha and beta are scalars, x and y are vectors and A is an
616 On entry, TRANS specifies the operation to be performed as
619 TRANS = 'N' or 'n' y := alpha*A*x + beta*y.
621 TRANS = 'T' or 't' y := alpha*A'*x + beta*y.
623 TRANS = 'C' or 'c' y := alpha*A'*x + beta*y.
628 On entry, M specifies the number of rows of the matrix A.
629 M must be at least zero.
633 On entry, N specifies the number of columns of the matrix A.
634 N must be at least zero.
638 On entry, ALPHA specifies the scalar alpha.
641 A - REAL array of DIMENSION ( LDA, n ).
642 Before entry, the leading m by n part of the array A must
643 contain the matrix of coefficients.
647 On entry, LDA specifies the first dimension of A as declared
648 in the calling (sub) program. LDA must be at least
652 X - REAL array of DIMENSION at least
653 ( 1 + ( n - 1 )*abs( INCX ) ) when TRANS = 'N' or 'n'
655 ( 1 + ( m - 1 )*abs( INCX ) ) otherwise.
656 Before entry, the incremented array X must contain the
661 On entry, INCX specifies the increment for the elements of
662 X. INCX must not be zero.
666 On entry, BETA specifies the scalar beta. When BETA is
667 supplied as zero then Y need not be set on input.
670 Y - REAL array of DIMENSION at least
671 ( 1 + ( m - 1 )*abs( INCY ) ) when TRANS = 'N' or 'n'
673 ( 1 + ( n - 1 )*abs( INCY ) ) otherwise.
674 Before entry with BETA non-zero, the incremented array Y
675 must contain the vector y. On exit, Y is overwritten by the
679 On entry, INCY specifies the increment for the elements of
680 Y. INCY must not be zero.
684 Level 2 Blas routine.
686 -- Written on 22-October-1986.
687 Jack Dongarra, Argonne National Lab.
688 Jeremy Du Croz, Nag Central Office.
689 Sven Hammarling, Nag Central Office.
690 Richard Hanson, Sandia National Labs.
693 Test the input parameters.
696 /* Parameter adjustments */
698 a_offset = 1 + a_dim1;
705 if (! lsame_(trans, "N") && ! lsame_(trans, "T") && ! lsame_(trans, "C")
712 } else if (*lda < max(1,*m)) {
714 } else if (*incx == 0) {
716 } else if (*incy == 0) {
720 xerbla_("SGEMV ", &info);
724 /* Quick return if possible. */
726 if (*m == 0 || *n == 0 || *alpha == 0.f && *beta == 1.f) {
731 Set LENX and LENY, the lengths of the vectors x and y, and set
732 up the start points in X and Y.
735 if (lsame_(trans, "N")) {
745 kx = 1 - (lenx - 1) * *incx;
750 ky = 1 - (leny - 1) * *incy;
754 Start the operations. In this version the elements of A are
755 accessed sequentially with one pass through A.
757 First form y := beta*y.
764 for (i__ = 1; i__ <= i__1; ++i__) {
770 for (i__ = 1; i__ <= i__1; ++i__) {
771 y[i__] = *beta * y[i__];
779 for (i__ = 1; i__ <= i__1; ++i__) {
786 for (i__ = 1; i__ <= i__1; ++i__) {
787 y[iy] = *beta * y[iy];
797 if (lsame_(trans, "N")) {
799 /* Form y := alpha*A*x + y. */
804 for (j = 1; j <= i__1; ++j) {
806 temp = *alpha * x[jx];
808 for (i__ = 1; i__ <= i__2; ++i__) {
809 y[i__] += temp * a[i__ + j * a_dim1];
818 for (j = 1; j <= i__1; ++j) {
820 temp = *alpha * x[jx];
823 for (i__ = 1; i__ <= i__2; ++i__) {
824 y[iy] += temp * a[i__ + j * a_dim1];
835 /* Form y := alpha*A'*x + y. */
840 for (j = 1; j <= i__1; ++j) {
843 for (i__ = 1; i__ <= i__2; ++i__) {
844 temp += a[i__ + j * a_dim1] * x[i__];
847 y[jy] += *alpha * temp;
853 for (j = 1; j <= i__1; ++j) {
857 for (i__ = 1; i__ <= i__2; ++i__) {
858 temp += a[i__ + j * a_dim1] * x[ix];
862 y[jy] += *alpha * temp;
875 /* Subroutine */ int sscal_(integer *n, real *sa, real *sx, integer *incx)
877 /* System generated locals */
880 /* Local variables */
881 static integer i__, m, mp1, nincx;
885 scales a vector by a constant.
886 uses unrolled loops for increment equal to 1.
887 jack dongarra, linpack, 3/11/78.
888 modified 3/93 to return if incx .le. 0.
889 modified 12/3/93, array(1) declarations changed to array(*)
893 /* Parameter adjustments */
897 if (*n <= 0 || *incx <= 0) {
904 /* code for increment not equal to 1 */
909 for (i__ = 1; i__2 < 0 ? i__ >= i__1 : i__ <= i__1; i__ += i__2) {
910 sx[i__] = *sa * sx[i__];
916 code for increment equal to 1
928 for (i__ = 1; i__ <= i__2; ++i__) {
929 sx[i__] = *sa * sx[i__];
938 for (i__ = mp1; i__ <= i__2; i__ += 5) {
939 sx[i__] = *sa * sx[i__];
940 sx[i__ + 1] = *sa * sx[i__ + 1];
941 sx[i__ + 2] = *sa * sx[i__ + 2];
942 sx[i__ + 3] = *sa * sx[i__ + 3];
943 sx[i__ + 4] = *sa * sx[i__ + 4];
949 /* Subroutine */ int ssymm_(char *side, char *uplo, integer *m, integer *n,
950 real *alpha, real *a, integer *lda, real *b, integer *ldb, real *beta,
951 real *c__, integer *ldc)
953 /* System generated locals */
954 integer a_dim1, a_offset, b_dim1, b_offset, c_dim1, c_offset, i__1, i__2,
957 /* Local variables */
958 static integer i__, j, k, info;
959 static real temp1, temp2;
960 extern logical lsame_(char *, char *);
961 static integer nrowa;
962 static logical upper;
963 extern /* Subroutine */ int xerbla_(char *, integer *);
970 SSYMM performs one of the matrix-matrix operations
972 C := alpha*A*B + beta*C,
976 C := alpha*B*A + beta*C,
978 where alpha and beta are scalars, A is a symmetric matrix and B and
979 C are m by n matrices.
985 On entry, SIDE specifies whether the symmetric matrix A
986 appears on the left or right in the operation as follows:
988 SIDE = 'L' or 'l' C := alpha*A*B + beta*C,
990 SIDE = 'R' or 'r' C := alpha*B*A + beta*C,
995 On entry, UPLO specifies whether the upper or lower
996 triangular part of the symmetric matrix A is to be
997 referenced as follows:
999 UPLO = 'U' or 'u' Only the upper triangular part of the
1000 symmetric matrix is to be referenced.
1002 UPLO = 'L' or 'l' Only the lower triangular part of the
1003 symmetric matrix is to be referenced.
1008 On entry, M specifies the number of rows of the matrix C.
1009 M must be at least zero.
1013 On entry, N specifies the number of columns of the matrix C.
1014 N must be at least zero.
1018 On entry, ALPHA specifies the scalar alpha.
1021 A - REAL array of DIMENSION ( LDA, ka ), where ka is
1022 m when SIDE = 'L' or 'l' and is n otherwise.
1023 Before entry with SIDE = 'L' or 'l', the m by m part of
1024 the array A must contain the symmetric matrix, such that
1025 when UPLO = 'U' or 'u', the leading m by m upper triangular
1026 part of the array A must contain the upper triangular part
1027 of the symmetric matrix and the strictly lower triangular
1028 part of A is not referenced, and when UPLO = 'L' or 'l',
1029 the leading m by m lower triangular part of the array A
1030 must contain the lower triangular part of the symmetric
1031 matrix and the strictly upper triangular part of A is not
1033 Before entry with SIDE = 'R' or 'r', the n by n part of
1034 the array A must contain the symmetric matrix, such that
1035 when UPLO = 'U' or 'u', the leading n by n upper triangular
1036 part of the array A must contain the upper triangular part
1037 of the symmetric matrix and the strictly lower triangular
1038 part of A is not referenced, and when UPLO = 'L' or 'l',
1039 the leading n by n lower triangular part of the array A
1040 must contain the lower triangular part of the symmetric
1041 matrix and the strictly upper triangular part of A is not
1046 On entry, LDA specifies the first dimension of A as declared
1047 in the calling (sub) program. When SIDE = 'L' or 'l' then
1048 LDA must be at least max( 1, m ), otherwise LDA must be at
1052 B - REAL array of DIMENSION ( LDB, n ).
1053 Before entry, the leading m by n part of the array B must
1054 contain the matrix B.
1058 On entry, LDB specifies the first dimension of B as declared
1059 in the calling (sub) program. LDB must be at least
1064 On entry, BETA specifies the scalar beta. When BETA is
1065 supplied as zero then C need not be set on input.
1068 C - REAL array of DIMENSION ( LDC, n ).
1069 Before entry, the leading m by n part of the array C must
1070 contain the matrix C, except when beta is zero, in which
1071 case C need not be set on entry.
1072 On exit, the array C is overwritten by the m by n updated
1076 On entry, LDC specifies the first dimension of C as declared
1077 in the calling (sub) program. LDC must be at least
1082 Level 3 Blas routine.
1084 -- Written on 8-February-1989.
1085 Jack Dongarra, Argonne National Laboratory.
1086 Iain Duff, AERE Harwell.
1087 Jeremy Du Croz, Numerical Algorithms Group Ltd.
1088 Sven Hammarling, Numerical Algorithms Group Ltd.
1091 Set NROWA as the number of rows of A.
1094 /* Parameter adjustments */
1096 a_offset = 1 + a_dim1;
1099 b_offset = 1 + b_dim1;
1102 c_offset = 1 + c_dim1;
1106 if (lsame_(side, "L")) {
1111 upper = lsame_(uplo, "U");
1113 /* Test the input parameters. */
1116 if (! lsame_(side, "L") && ! lsame_(side, "R")) {
1118 } else if (! upper && ! lsame_(uplo, "L")) {
1120 } else if (*m < 0) {
1122 } else if (*n < 0) {
1124 } else if (*lda < max(1,nrowa)) {
1126 } else if (*ldb < max(1,*m)) {
1128 } else if (*ldc < max(1,*m)) {
1132 xerbla_("SSYMM ", &info);
1136 /* Quick return if possible. */
1138 if (*m == 0 || *n == 0 || *alpha == 0.f && *beta == 1.f) {
1142 /* And when alpha.eq.zero. */
1144 if (*alpha == 0.f) {
1147 for (j = 1; j <= i__1; ++j) {
1149 for (i__ = 1; i__ <= i__2; ++i__) {
1150 c__[i__ + j * c_dim1] = 0.f;
1157 for (j = 1; j <= i__1; ++j) {
1159 for (i__ = 1; i__ <= i__2; ++i__) {
1160 c__[i__ + j * c_dim1] = *beta * c__[i__ + j * c_dim1];
1169 /* Start the operations. */
1171 if (lsame_(side, "L")) {
1173 /* Form C := alpha*A*B + beta*C. */
1177 for (j = 1; j <= i__1; ++j) {
1179 for (i__ = 1; i__ <= i__2; ++i__) {
1180 temp1 = *alpha * b[i__ + j * b_dim1];
1183 for (k = 1; k <= i__3; ++k) {
1184 c__[k + j * c_dim1] += temp1 * a[k + i__ * a_dim1];
1185 temp2 += b[k + j * b_dim1] * a[k + i__ * a_dim1];
1189 c__[i__ + j * c_dim1] = temp1 * a[i__ + i__ * a_dim1]
1192 c__[i__ + j * c_dim1] = *beta * c__[i__ + j * c_dim1]
1193 + temp1 * a[i__ + i__ * a_dim1] + *alpha *
1202 for (j = 1; j <= i__1; ++j) {
1203 for (i__ = *m; i__ >= 1; --i__) {
1204 temp1 = *alpha * b[i__ + j * b_dim1];
1207 for (k = i__ + 1; k <= i__2; ++k) {
1208 c__[k + j * c_dim1] += temp1 * a[k + i__ * a_dim1];
1209 temp2 += b[k + j * b_dim1] * a[k + i__ * a_dim1];
1213 c__[i__ + j * c_dim1] = temp1 * a[i__ + i__ * a_dim1]
1216 c__[i__ + j * c_dim1] = *beta * c__[i__ + j * c_dim1]
1217 + temp1 * a[i__ + i__ * a_dim1] + *alpha *
1227 /* Form C := alpha*B*A + beta*C. */
1230 for (j = 1; j <= i__1; ++j) {
1231 temp1 = *alpha * a[j + j * a_dim1];
1234 for (i__ = 1; i__ <= i__2; ++i__) {
1235 c__[i__ + j * c_dim1] = temp1 * b[i__ + j * b_dim1];
1240 for (i__ = 1; i__ <= i__2; ++i__) {
1241 c__[i__ + j * c_dim1] = *beta * c__[i__ + j * c_dim1] +
1242 temp1 * b[i__ + j * b_dim1];
1247 for (k = 1; k <= i__2; ++k) {
1249 temp1 = *alpha * a[k + j * a_dim1];
1251 temp1 = *alpha * a[j + k * a_dim1];
1254 for (i__ = 1; i__ <= i__3; ++i__) {
1255 c__[i__ + j * c_dim1] += temp1 * b[i__ + k * b_dim1];
1261 for (k = j + 1; k <= i__2; ++k) {
1263 temp1 = *alpha * a[j + k * a_dim1];
1265 temp1 = *alpha * a[k + j * a_dim1];
1268 for (i__ = 1; i__ <= i__3; ++i__) {
1269 c__[i__ + j * c_dim1] += temp1 * b[i__ + k * b_dim1];
1280 /* End of SSYMM . */
1284 /* Subroutine */ int ssyrk_(char *uplo, char *trans, integer *n, integer *k,
1285 real *alpha, real *a, integer *lda, real *beta, real *c__, integer *
1288 /* System generated locals */
1289 integer a_dim1, a_offset, c_dim1, c_offset, i__1, i__2, i__3;
1291 /* Local variables */
1292 static integer i__, j, l, info;
1294 extern logical lsame_(char *, char *);
1295 static integer nrowa;
1296 static logical upper;
1297 extern /* Subroutine */ int xerbla_(char *, integer *);
1304 SSYRK performs one of the symmetric rank k operations
1306 C := alpha*A*A' + beta*C,
1310 C := alpha*A'*A + beta*C,
1312 where alpha and beta are scalars, C is an n by n symmetric matrix
1313 and A is an n by k matrix in the first case and a k by n matrix
1320 On entry, UPLO specifies whether the upper or lower
1321 triangular part of the array C is to be referenced as
1324 UPLO = 'U' or 'u' Only the upper triangular part of C
1325 is to be referenced.
1327 UPLO = 'L' or 'l' Only the lower triangular part of C
1328 is to be referenced.
1332 TRANS - CHARACTER*1.
1333 On entry, TRANS specifies the operation to be performed as
1336 TRANS = 'N' or 'n' C := alpha*A*A' + beta*C.
1338 TRANS = 'T' or 't' C := alpha*A'*A + beta*C.
1340 TRANS = 'C' or 'c' C := alpha*A'*A + beta*C.
1345 On entry, N specifies the order of the matrix C. N must be
1350 On entry with TRANS = 'N' or 'n', K specifies the number
1351 of columns of the matrix A, and on entry with
1352 TRANS = 'T' or 't' or 'C' or 'c', K specifies the number
1353 of rows of the matrix A. K must be at least zero.
1357 On entry, ALPHA specifies the scalar alpha.
1360 A - REAL array of DIMENSION ( LDA, ka ), where ka is
1361 k when TRANS = 'N' or 'n', and is n otherwise.
1362 Before entry with TRANS = 'N' or 'n', the leading n by k
1363 part of the array A must contain the matrix A, otherwise
1364 the leading k by n part of the array A must contain the
1369 On entry, LDA specifies the first dimension of A as declared
1370 in the calling (sub) program. When TRANS = 'N' or 'n'
1371 then LDA must be at least max( 1, n ), otherwise LDA must
1372 be at least max( 1, k ).
1376 On entry, BETA specifies the scalar beta.
1379 C - REAL array of DIMENSION ( LDC, n ).
1380 Before entry with UPLO = 'U' or 'u', the leading n by n
1381 upper triangular part of the array C must contain the upper
1382 triangular part of the symmetric matrix and the strictly
1383 lower triangular part of C is not referenced. On exit, the
1384 upper triangular part of the array C is overwritten by the
1385 upper triangular part of the updated matrix.
1386 Before entry with UPLO = 'L' or 'l', the leading n by n
1387 lower triangular part of the array C must contain the lower
1388 triangular part of the symmetric matrix and the strictly
1389 upper triangular part of C is not referenced. On exit, the
1390 lower triangular part of the array C is overwritten by the
1391 lower triangular part of the updated matrix.
1394 On entry, LDC specifies the first dimension of C as declared
1395 in the calling (sub) program. LDC must be at least
1400 Level 3 Blas routine.
1402 -- Written on 8-February-1989.
1403 Jack Dongarra, Argonne National Laboratory.
1404 Iain Duff, AERE Harwell.
1405 Jeremy Du Croz, Numerical Algorithms Group Ltd.
1406 Sven Hammarling, Numerical Algorithms Group Ltd.
1409 Test the input parameters.
1412 /* Parameter adjustments */
1414 a_offset = 1 + a_dim1;
1417 c_offset = 1 + c_dim1;
1421 if (lsame_(trans, "N")) {
1426 upper = lsame_(uplo, "U");
1429 if (! upper && ! lsame_(uplo, "L")) {
1431 } else if (! lsame_(trans, "N") && ! lsame_(trans,
1432 "T") && ! lsame_(trans, "C")) {
1434 } else if (*n < 0) {
1436 } else if (*k < 0) {
1438 } else if (*lda < max(1,nrowa)) {
1440 } else if (*ldc < max(1,*n)) {
1444 xerbla_("SSYRK ", &info);
1448 /* Quick return if possible. */
1450 if (*n == 0 || (*alpha == 0.f || *k == 0) && *beta == 1.f) {
1454 /* And when alpha.eq.zero. */
1456 if (*alpha == 0.f) {
1460 for (j = 1; j <= i__1; ++j) {
1462 for (i__ = 1; i__ <= i__2; ++i__) {
1463 c__[i__ + j * c_dim1] = 0.f;
1470 for (j = 1; j <= i__1; ++j) {
1472 for (i__ = 1; i__ <= i__2; ++i__) {
1473 c__[i__ + j * c_dim1] = *beta * c__[i__ + j * c_dim1];
1482 for (j = 1; j <= i__1; ++j) {
1484 for (i__ = j; i__ <= i__2; ++i__) {
1485 c__[i__ + j * c_dim1] = 0.f;
1492 for (j = 1; j <= i__1; ++j) {
1494 for (i__ = j; i__ <= i__2; ++i__) {
1495 c__[i__ + j * c_dim1] = *beta * c__[i__ + j * c_dim1];
1505 /* Start the operations. */
1507 if (lsame_(trans, "N")) {
1509 /* Form C := alpha*A*A' + beta*C. */
1513 for (j = 1; j <= i__1; ++j) {
1516 for (i__ = 1; i__ <= i__2; ++i__) {
1517 c__[i__ + j * c_dim1] = 0.f;
1520 } else if (*beta != 1.f) {
1522 for (i__ = 1; i__ <= i__2; ++i__) {
1523 c__[i__ + j * c_dim1] = *beta * c__[i__ + j * c_dim1];
1528 for (l = 1; l <= i__2; ++l) {
1529 if (a[j + l * a_dim1] != 0.f) {
1530 temp = *alpha * a[j + l * a_dim1];
1532 for (i__ = 1; i__ <= i__3; ++i__) {
1533 c__[i__ + j * c_dim1] += temp * a[i__ + l *
1544 for (j = 1; j <= i__1; ++j) {
1547 for (i__ = j; i__ <= i__2; ++i__) {
1548 c__[i__ + j * c_dim1] = 0.f;
1551 } else if (*beta != 1.f) {
1553 for (i__ = j; i__ <= i__2; ++i__) {
1554 c__[i__ + j * c_dim1] = *beta * c__[i__ + j * c_dim1];
1559 for (l = 1; l <= i__2; ++l) {
1560 if (a[j + l * a_dim1] != 0.f) {
1561 temp = *alpha * a[j + l * a_dim1];
1563 for (i__ = j; i__ <= i__3; ++i__) {
1564 c__[i__ + j * c_dim1] += temp * a[i__ + l *
1576 /* Form C := alpha*A'*A + beta*C. */
1580 for (j = 1; j <= i__1; ++j) {
1582 for (i__ = 1; i__ <= i__2; ++i__) {
1585 for (l = 1; l <= i__3; ++l) {
1586 temp += a[l + i__ * a_dim1] * a[l + j * a_dim1];
1590 c__[i__ + j * c_dim1] = *alpha * temp;
1592 c__[i__ + j * c_dim1] = *alpha * temp + *beta * c__[
1601 for (j = 1; j <= i__1; ++j) {
1603 for (i__ = j; i__ <= i__2; ++i__) {
1606 for (l = 1; l <= i__3; ++l) {
1607 temp += a[l + i__ * a_dim1] * a[l + j * a_dim1];
1611 c__[i__ + j * c_dim1] = *alpha * temp;
1613 c__[i__ + j * c_dim1] = *alpha * temp + *beta * c__[
1625 /* End of SSYRK . */
1629 /* Subroutine */ int strsm_(char *side, char *uplo, char *transa, char *diag,
1630 integer *m, integer *n, real *alpha, real *a, integer *lda, real *b,
1633 /* System generated locals */
1634 integer a_dim1, a_offset, b_dim1, b_offset, i__1, i__2, i__3;
1636 /* Local variables */
1637 static integer i__, j, k, info;
1639 static logical lside;
1640 extern logical lsame_(char *, char *);
1641 static integer nrowa;
1642 static logical upper;
1643 extern /* Subroutine */ int xerbla_(char *, integer *);
1644 static logical nounit;
1651 STRSM solves one of the matrix equations
1653 op( A )*X = alpha*B, or X*op( A ) = alpha*B,
1655 where alpha is a scalar, X and B are m by n matrices, A is a unit, or
1656 non-unit, upper or lower triangular matrix and op( A ) is one of
1658 op( A ) = A or op( A ) = A'.
1660 The matrix X is overwritten on B.
1666 On entry, SIDE specifies whether op( A ) appears on the left
1667 or right of X as follows:
1669 SIDE = 'L' or 'l' op( A )*X = alpha*B.
1671 SIDE = 'R' or 'r' X*op( A ) = alpha*B.
1676 On entry, UPLO specifies whether the matrix A is an upper or
1677 lower triangular matrix as follows:
1679 UPLO = 'U' or 'u' A is an upper triangular matrix.
1681 UPLO = 'L' or 'l' A is a lower triangular matrix.
1685 TRANSA - CHARACTER*1.
1686 On entry, TRANSA specifies the form of op( A ) to be used in
1687 the matrix multiplication as follows:
1689 TRANSA = 'N' or 'n' op( A ) = A.
1691 TRANSA = 'T' or 't' op( A ) = A'.
1693 TRANSA = 'C' or 'c' op( A ) = A'.
1698 On entry, DIAG specifies whether or not A is unit triangular
1701 DIAG = 'U' or 'u' A is assumed to be unit triangular.
1703 DIAG = 'N' or 'n' A is not assumed to be unit
1709 On entry, M specifies the number of rows of B. M must be at
1714 On entry, N specifies the number of columns of B. N must be
1719 On entry, ALPHA specifies the scalar alpha. When alpha is
1720 zero then A is not referenced and B need not be set before
1724 A - REAL array of DIMENSION ( LDA, k ), where k is m
1725 when SIDE = 'L' or 'l' and is n when SIDE = 'R' or 'r'.
1726 Before entry with UPLO = 'U' or 'u', the leading k by k
1727 upper triangular part of the array A must contain the upper
1728 triangular matrix and the strictly lower triangular part of
1729 A is not referenced.
1730 Before entry with UPLO = 'L' or 'l', the leading k by k
1731 lower triangular part of the array A must contain the lower
1732 triangular matrix and the strictly upper triangular part of
1733 A is not referenced.
1734 Note that when DIAG = 'U' or 'u', the diagonal elements of
1735 A are not referenced either, but are assumed to be unity.
1739 On entry, LDA specifies the first dimension of A as declared
1740 in the calling (sub) program. When SIDE = 'L' or 'l' then
1741 LDA must be at least max( 1, m ), when SIDE = 'R' or 'r'
1742 then LDA must be at least max( 1, n ).
1745 B - REAL array of DIMENSION ( LDB, n ).
1746 Before entry, the leading m by n part of the array B must
1747 contain the right-hand side matrix B, and on exit is
1748 overwritten by the solution matrix X.
1751 On entry, LDB specifies the first dimension of B as declared
1752 in the calling (sub) program. LDB must be at least
1757 Level 3 Blas routine.
1760 -- Written on 8-February-1989.
1761 Jack Dongarra, Argonne National Laboratory.
1762 Iain Duff, AERE Harwell.
1763 Jeremy Du Croz, Numerical Algorithms Group Ltd.
1764 Sven Hammarling, Numerical Algorithms Group Ltd.
1767 Test the input parameters.
1770 /* Parameter adjustments */
1772 a_offset = 1 + a_dim1;
1775 b_offset = 1 + b_dim1;
1779 lside = lsame_(side, "L");
1785 nounit = lsame_(diag, "N");
1786 upper = lsame_(uplo, "U");
1789 if (! lside && ! lsame_(side, "R")) {
1791 } else if (! upper && ! lsame_(uplo, "L")) {
1793 } else if (! lsame_(transa, "N") && ! lsame_(transa,
1794 "T") && ! lsame_(transa, "C")) {
1796 } else if (! lsame_(diag, "U") && ! lsame_(diag,
1799 } else if (*m < 0) {
1801 } else if (*n < 0) {
1803 } else if (*lda < max(1,nrowa)) {
1805 } else if (*ldb < max(1,*m)) {
1809 xerbla_("STRSM ", &info);
1813 /* Quick return if possible. */
1819 /* And when alpha.eq.zero. */
1821 if (*alpha == 0.f) {
1823 for (j = 1; j <= i__1; ++j) {
1825 for (i__ = 1; i__ <= i__2; ++i__) {
1826 b[i__ + j * b_dim1] = 0.f;
1834 /* Start the operations. */
1837 if (lsame_(transa, "N")) {
1839 /* Form B := alpha*inv( A )*B. */
1843 for (j = 1; j <= i__1; ++j) {
1844 if (*alpha != 1.f) {
1846 for (i__ = 1; i__ <= i__2; ++i__) {
1847 b[i__ + j * b_dim1] = *alpha * b[i__ + j * b_dim1]
1852 for (k = *m; k >= 1; --k) {
1853 if (b[k + j * b_dim1] != 0.f) {
1855 b[k + j * b_dim1] /= a[k + k * a_dim1];
1858 for (i__ = 1; i__ <= i__2; ++i__) {
1859 b[i__ + j * b_dim1] -= b[k + j * b_dim1] * a[
1870 for (j = 1; j <= i__1; ++j) {
1871 if (*alpha != 1.f) {
1873 for (i__ = 1; i__ <= i__2; ++i__) {
1874 b[i__ + j * b_dim1] = *alpha * b[i__ + j * b_dim1]
1880 for (k = 1; k <= i__2; ++k) {
1881 if (b[k + j * b_dim1] != 0.f) {
1883 b[k + j * b_dim1] /= a[k + k * a_dim1];
1886 for (i__ = k + 1; i__ <= i__3; ++i__) {
1887 b[i__ + j * b_dim1] -= b[k + j * b_dim1] * a[
1899 /* Form B := alpha*inv( A' )*B. */
1903 for (j = 1; j <= i__1; ++j) {
1905 for (i__ = 1; i__ <= i__2; ++i__) {
1906 temp = *alpha * b[i__ + j * b_dim1];
1908 for (k = 1; k <= i__3; ++k) {
1909 temp -= a[k + i__ * a_dim1] * b[k + j * b_dim1];
1913 temp /= a[i__ + i__ * a_dim1];
1915 b[i__ + j * b_dim1] = temp;
1922 for (j = 1; j <= i__1; ++j) {
1923 for (i__ = *m; i__ >= 1; --i__) {
1924 temp = *alpha * b[i__ + j * b_dim1];
1926 for (k = i__ + 1; k <= i__2; ++k) {
1927 temp -= a[k + i__ * a_dim1] * b[k + j * b_dim1];
1931 temp /= a[i__ + i__ * a_dim1];
1933 b[i__ + j * b_dim1] = temp;
1941 if (lsame_(transa, "N")) {
1943 /* Form B := alpha*B*inv( A ). */
1947 for (j = 1; j <= i__1; ++j) {
1948 if (*alpha != 1.f) {
1950 for (i__ = 1; i__ <= i__2; ++i__) {
1951 b[i__ + j * b_dim1] = *alpha * b[i__ + j * b_dim1]
1957 for (k = 1; k <= i__2; ++k) {
1958 if (a[k + j * a_dim1] != 0.f) {
1960 for (i__ = 1; i__ <= i__3; ++i__) {
1961 b[i__ + j * b_dim1] -= a[k + j * a_dim1] * b[
1969 temp = 1.f / a[j + j * a_dim1];
1971 for (i__ = 1; i__ <= i__2; ++i__) {
1972 b[i__ + j * b_dim1] = temp * b[i__ + j * b_dim1];
1979 for (j = *n; j >= 1; --j) {
1980 if (*alpha != 1.f) {
1982 for (i__ = 1; i__ <= i__1; ++i__) {
1983 b[i__ + j * b_dim1] = *alpha * b[i__ + j * b_dim1]
1989 for (k = j + 1; k <= i__1; ++k) {
1990 if (a[k + j * a_dim1] != 0.f) {
1992 for (i__ = 1; i__ <= i__2; ++i__) {
1993 b[i__ + j * b_dim1] -= a[k + j * a_dim1] * b[
2001 temp = 1.f / a[j + j * a_dim1];
2003 for (i__ = 1; i__ <= i__1; ++i__) {
2004 b[i__ + j * b_dim1] = temp * b[i__ + j * b_dim1];
2013 /* Form B := alpha*B*inv( A' ). */
2016 for (k = *n; k >= 1; --k) {
2018 temp = 1.f / a[k + k * a_dim1];
2020 for (i__ = 1; i__ <= i__1; ++i__) {
2021 b[i__ + k * b_dim1] = temp * b[i__ + k * b_dim1];
2026 for (j = 1; j <= i__1; ++j) {
2027 if (a[j + k * a_dim1] != 0.f) {
2028 temp = a[j + k * a_dim1];
2030 for (i__ = 1; i__ <= i__2; ++i__) {
2031 b[i__ + j * b_dim1] -= temp * b[i__ + k *
2038 if (*alpha != 1.f) {
2040 for (i__ = 1; i__ <= i__1; ++i__) {
2041 b[i__ + k * b_dim1] = *alpha * b[i__ + k * b_dim1]
2050 for (k = 1; k <= i__1; ++k) {
2052 temp = 1.f / a[k + k * a_dim1];
2054 for (i__ = 1; i__ <= i__2; ++i__) {
2055 b[i__ + k * b_dim1] = temp * b[i__ + k * b_dim1];
2060 for (j = k + 1; j <= i__2; ++j) {
2061 if (a[j + k * a_dim1] != 0.f) {
2062 temp = a[j + k * a_dim1];
2064 for (i__ = 1; i__ <= i__3; ++i__) {
2065 b[i__ + j * b_dim1] -= temp * b[i__ + k *
2072 if (*alpha != 1.f) {
2074 for (i__ = 1; i__ <= i__2; ++i__) {
2075 b[i__ + k * b_dim1] = *alpha * b[i__ + k * b_dim1]
2088 /* End of STRSM . */
2092 /* Subroutine */ int xerbla_(char *srname, integer *info)
2094 /* Format strings */
2095 static char fmt_9999[] = "(\002 ** On entry to \002,a6,\002 parameter nu"
2096 "mber \002,i2,\002 had \002,\002an illegal value\002)";
2098 /* Builtin functions */
2099 integer s_wsfe(cilist *), do_fio(integer *, char *, ftnlen), e_wsfe(void);
2100 /* Subroutine */ int s_stop(char *, ftnlen);
2102 /* Fortran I/O blocks */
2103 static cilist io___60 = { 0, 6, 0, fmt_9999, 0 };
2107 -- LAPACK auxiliary routine (preliminary version) --
2108 Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,
2109 Courant Institute, Argonne National Lab, and Rice University
2116 XERBLA is an error handler for the LAPACK routines.
2117 It is called by an LAPACK routine if an input parameter has an
2118 invalid value. A message is printed and execution stops.
2120 Installers may consider modifying the STOP statement in order to
2121 call system-specific exception-handling facilities.
2126 SRNAME (input) CHARACTER*6
2127 The name of the routine which called XERBLA.
2129 INFO (input) INTEGER
2130 The position of the invalid parameter in the parameter list
2131 of the calling routine.
2136 do_fio(&c__1, srname, (ftnlen)6);
2137 do_fio(&c__1, (char *)&(*info), (ftnlen)sizeof(integer));
2140 s_stop("", (ftnlen)0);