1 /* ./src_f77/zlacpy.f -- translated by f2c (version 20030320).
2    You must link the resulting object file with the libraries:
3 	-lf2c -lm   (in that order)
4 */
5 
6 #include <punc/vf2c.h>
7 
zlacpy_(char * uplo,integer * m,integer * n,doublecomplex * a,integer * lda,doublecomplex * b,integer * ldb,ftnlen uplo_len)8 /* Subroutine */ int zlacpy_(char *uplo, integer *m, integer *n,
9 	doublecomplex *a, integer *lda, doublecomplex *b, integer *ldb,
10 	ftnlen uplo_len)
11 {
12     /* System generated locals */
13     integer a_dim1, a_offset, b_dim1, b_offset, i__1, i__2, i__3, i__4;
14 
15     /* Local variables */
16     static integer i__, j;
17     extern logical lsame_(char *, char *, ftnlen, ftnlen);
18 
19 
20 /*  -- LAPACK auxiliary routine (version 3.0) -- */
21 /*     Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., */
22 /*     Courant Institute, Argonne National Lab, and Rice University */
23 /*     February 29, 1992 */
24 
25 /*     .. Scalar Arguments .. */
26 /*     .. */
27 /*     .. Array Arguments .. */
28 /*     .. */
29 
30 /*  Purpose */
31 /*  ======= */
32 
33 /*  ZLACPY copies all or part of a two-dimensional matrix A to another */
34 /*  matrix B. */
35 
36 /*  Arguments */
37 /*  ========= */
38 
39 /*  UPLO    (input) CHARACTER*1 */
40 /*          Specifies the part of the matrix A to be copied to B. */
41 /*          = 'U':      Upper triangular part */
42 /*          = 'L':      Lower triangular part */
43 /*          Otherwise:  All of the matrix A */
44 
45 /*  M       (input) INTEGER */
46 /*          The number of rows of the matrix A.  M >= 0. */
47 
48 /*  N       (input) INTEGER */
49 /*          The number of columns of the matrix A.  N >= 0. */
50 
51 /*  A       (input) COMPLEX*16 array, dimension (LDA,N) */
52 /*          The m by n matrix A.  If UPLO = 'U', only the upper trapezium */
53 /*          is accessed; if UPLO = 'L', only the lower trapezium is */
54 /*          accessed. */
55 
56 /*  LDA     (input) INTEGER */
57 /*          The leading dimension of the array A.  LDA >= max(1,M). */
58 
59 /*  B       (output) COMPLEX*16 array, dimension (LDB,N) */
60 /*          On exit, B = A in the locations specified by UPLO. */
61 
62 /*  LDB     (input) INTEGER */
63 /*          The leading dimension of the array B.  LDB >= max(1,M). */
64 
65 /*  ===================================================================== */
66 
67 /*     .. Local Scalars .. */
68 /*     .. */
69 /*     .. External Functions .. */
70 /*     .. */
71 /*     .. Intrinsic Functions .. */
72 /*     .. */
73 /*     .. Executable Statements .. */
74 
75     /* Parameter adjustments */
76     a_dim1 = *lda;
77     a_offset = 1 + a_dim1;
78     a -= a_offset;
79     b_dim1 = *ldb;
80     b_offset = 1 + b_dim1;
81     b -= b_offset;
82 
83     /* Function Body */
84     if (lsame_(uplo, "U", (ftnlen)1, (ftnlen)1)) {
85 	i__1 = *n;
86 	for (j = 1; j <= i__1; ++j) {
87 	    i__2 = min(j,*m);
88 	    for (i__ = 1; i__ <= i__2; ++i__) {
89 		i__3 = i__ + j * b_dim1;
90 		i__4 = i__ + j * a_dim1;
91 		b[i__3].r = a[i__4].r, b[i__3].i = a[i__4].i;
92 /* L10: */
93 	    }
94 /* L20: */
95 	}
96 
97     } else if (lsame_(uplo, "L", (ftnlen)1, (ftnlen)1)) {
98 	i__1 = *n;
99 	for (j = 1; j <= i__1; ++j) {
100 	    i__2 = *m;
101 	    for (i__ = j; i__ <= i__2; ++i__) {
102 		i__3 = i__ + j * b_dim1;
103 		i__4 = i__ + j * a_dim1;
104 		b[i__3].r = a[i__4].r, b[i__3].i = a[i__4].i;
105 /* L30: */
106 	    }
107 /* L40: */
108 	}
109 
110     } else {
111 	i__1 = *n;
112 	for (j = 1; j <= i__1; ++j) {
113 	    i__2 = *m;
114 	    for (i__ = 1; i__ <= i__2; ++i__) {
115 		i__3 = i__ + j * b_dim1;
116 		i__4 = i__ + j * a_dim1;
117 		b[i__3].r = a[i__4].r, b[i__3].i = a[i__4].i;
118 /* L50: */
119 	    }
120 /* L60: */
121 	}
122     }
123 
124     return 0;
125 
126 /*     End of ZLACPY */
127 
128 } /* zlacpy_ */
129 
130