3 /* Subroutine */ int slacpy_(char *uplo, integer *m, integer *n, real *a,
4 integer *lda, real *b, integer *ldb)
6 /* System generated locals */
7 integer a_dim1, a_offset, b_dim1, b_offset, i__1, i__2;
11 extern logical lsame_(char *, char *);
14 /* -- LAPACK auxiliary routine (version 3.1) -- */
15 /* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. */
18 /* .. Scalar Arguments .. */
20 /* .. Array Arguments .. */
26 /* SLACPY copies all or part of a two-dimensional matrix A to another */
32 /* UPLO (input) CHARACTER*1 */
33 /* Specifies the part of the matrix A to be copied to B. */
34 /* = 'U': Upper triangular part */
35 /* = 'L': Lower triangular part */
36 /* Otherwise: All of the matrix A */
38 /* M (input) INTEGER */
39 /* The number of rows of the matrix A. M >= 0. */
41 /* N (input) INTEGER */
42 /* The number of columns of the matrix A. N >= 0. */
44 /* A (input) REAL array, dimension (LDA,N) */
45 /* The m by n matrix A. If UPLO = 'U', only the upper triangle */
46 /* or trapezoid is accessed; if UPLO = 'L', only the lower */
47 /* triangle or trapezoid is accessed. */
49 /* LDA (input) INTEGER */
50 /* The leading dimension of the array A. LDA >= max(1,M). */
52 /* B (output) REAL array, dimension (LDB,N) */
53 /* On exit, B = A in the locations specified by UPLO. */
55 /* LDB (input) INTEGER */
56 /* The leading dimension of the array B. LDB >= max(1,M). */
58 /* ===================================================================== */
60 /* .. Local Scalars .. */
62 /* .. External Functions .. */
64 /* .. Intrinsic Functions .. */
66 /* .. Executable Statements .. */
68 /* Parameter adjustments */
70 a_offset = 1 + a_dim1;
73 b_offset = 1 + b_dim1;
77 if (lsame_(uplo, "U")) {
79 for (j = 1; j <= i__1; ++j) {
81 for (i__ = 1; i__ <= i__2; ++i__) {
82 b[i__ + j * b_dim1] = a[i__ + j * a_dim1];
87 } else if (lsame_(uplo, "L")) {
89 for (j = 1; j <= i__1; ++j) {
91 for (i__ = j; i__ <= i__2; ++i__) {
92 b[i__ + j * b_dim1] = a[i__ + j * a_dim1];
99 for (j = 1; j <= i__1; ++j) {
101 for (i__ = 1; i__ <= i__2; ++i__) {
102 b[i__ + j * b_dim1] = a[i__ + j * a_dim1];