LAPACK 3.12.0
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches

◆ clacpy()

subroutine clacpy ( character  uplo,
integer  m,
integer  n,
complex, dimension( lda, * )  a,
integer  lda,
complex, dimension( ldb, * )  b,
integer  ldb 
)

CLACPY copies all or part of one two-dimensional array to another.

Download CLACPY + dependencies [TGZ] [ZIP] [TXT]

Purpose:
 CLACPY copies all or part of a two-dimensional matrix A to another
 matrix B.
Parameters
[in]UPLO
          UPLO is CHARACTER*1
          Specifies the part of the matrix A to be copied to B.
          = 'U':      Upper triangular part
          = 'L':      Lower triangular part
          Otherwise:  All of the matrix A
[in]M
          M is INTEGER
          The number of rows of the matrix A.  M >= 0.
[in]N
          N is INTEGER
          The number of columns of the matrix A.  N >= 0.
[in]A
          A is COMPLEX array, dimension (LDA,N)
          The m by n matrix A.  If UPLO = 'U', only the upper trapezium
          is accessed; if UPLO = 'L', only the lower trapezium is
          accessed.
[in]LDA
          LDA is INTEGER
          The leading dimension of the array A.  LDA >= max(1,M).
[out]B
          B is COMPLEX array, dimension (LDB,N)
          On exit, B = A in the locations specified by UPLO.
[in]LDB
          LDB is INTEGER
          The leading dimension of the array B.  LDB >= max(1,M).
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.

Definition at line 102 of file clacpy.f.

103*
104* -- LAPACK auxiliary routine --
105* -- LAPACK is a software package provided by Univ. of Tennessee, --
106* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
107*
108* .. Scalar Arguments ..
109 CHARACTER UPLO
110 INTEGER LDA, LDB, M, N
111* ..
112* .. Array Arguments ..
113 COMPLEX A( LDA, * ), B( LDB, * )
114* ..
115*
116* =====================================================================
117*
118* .. Local Scalars ..
119 INTEGER I, J
120* ..
121* .. External Functions ..
122 LOGICAL LSAME
123 EXTERNAL lsame
124* ..
125* .. Intrinsic Functions ..
126 INTRINSIC min
127* ..
128* .. Executable Statements ..
129*
130 IF( lsame( uplo, 'U' ) ) THEN
131 DO 20 j = 1, n
132 DO 10 i = 1, min( j, m )
133 b( i, j ) = a( i, j )
134 10 CONTINUE
135 20 CONTINUE
136*
137 ELSE IF( lsame( uplo, 'L' ) ) THEN
138 DO 40 j = 1, n
139 DO 30 i = j, m
140 b( i, j ) = a( i, j )
141 30 CONTINUE
142 40 CONTINUE
143*
144 ELSE
145 DO 60 j = 1, n
146 DO 50 i = 1, m
147 b( i, j ) = a( i, j )
148 50 CONTINUE
149 60 CONTINUE
150 END IF
151*
152 RETURN
153*
154* End of CLACPY
155*
logical function lsame(ca, cb)
LSAME
Definition lsame.f:48