LAPACK 3.3.1 Linear Algebra PACKage

# clacpy.f

Go to the documentation of this file.
```00001       SUBROUTINE CLACPY( UPLO, M, N, A, LDA, B, LDB )
00002 *
00003 *  -- LAPACK auxiliary routine (version 3.2) --
00004 *  -- LAPACK is a software package provided by Univ. of Tennessee,    --
00005 *  -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
00006 *     November 2006
00007 *
00008 *     .. Scalar Arguments ..
00009       CHARACTER          UPLO
00010       INTEGER            LDA, LDB, M, N
00011 *     ..
00012 *     .. Array Arguments ..
00013       COMPLEX            A( LDA, * ), B( LDB, * )
00014 *     ..
00015 *
00016 *  Purpose
00017 *  =======
00018 *
00019 *  CLACPY copies all or part of a two-dimensional matrix A to another
00020 *  matrix B.
00021 *
00022 *  Arguments
00023 *  =========
00024 *
00025 *  UPLO    (input) CHARACTER*1
00026 *          Specifies the part of the matrix A to be copied to B.
00027 *          = 'U':      Upper triangular part
00028 *          = 'L':      Lower triangular part
00029 *          Otherwise:  All of the matrix A
00030 *
00031 *  M       (input) INTEGER
00032 *          The number of rows of the matrix A.  M >= 0.
00033 *
00034 *  N       (input) INTEGER
00035 *          The number of columns of the matrix A.  N >= 0.
00036 *
00037 *  A       (input) COMPLEX array, dimension (LDA,N)
00038 *          The m by n matrix A.  If UPLO = 'U', only the upper trapezium
00039 *          is accessed; if UPLO = 'L', only the lower trapezium is
00040 *          accessed.
00041 *
00042 *  LDA     (input) INTEGER
00043 *          The leading dimension of the array A.  LDA >= max(1,M).
00044 *
00045 *  B       (output) COMPLEX array, dimension (LDB,N)
00046 *          On exit, B = A in the locations specified by UPLO.
00047 *
00048 *  LDB     (input) INTEGER
00049 *          The leading dimension of the array B.  LDB >= max(1,M).
00050 *
00051 *  =====================================================================
00052 *
00053 *     .. Local Scalars ..
00054       INTEGER            I, J
00055 *     ..
00056 *     .. External Functions ..
00057       LOGICAL            LSAME
00058       EXTERNAL           LSAME
00059 *     ..
00060 *     .. Intrinsic Functions ..
00061       INTRINSIC          MIN
00062 *     ..
00063 *     .. Executable Statements ..
00064 *
00065       IF( LSAME( UPLO, 'U' ) ) THEN
00066          DO 20 J = 1, N
00067             DO 10 I = 1, MIN( J, M )
00068                B( I, J ) = A( I, J )
00069    10       CONTINUE
00070    20    CONTINUE
00071 *
00072       ELSE IF( LSAME( UPLO, 'L' ) ) THEN
00073          DO 40 J = 1, N
00074             DO 30 I = J, M
00075                B( I, J ) = A( I, J )
00076    30       CONTINUE
00077    40    CONTINUE
00078 *
00079       ELSE
00080          DO 60 J = 1, N
00081             DO 50 I = 1, M
00082                B( I, J ) = A( I, J )
00083    50       CONTINUE
00084    60    CONTINUE
00085       END IF
00086 *
00087       RETURN
00088 *
00089 *     End of CLACPY
00090 *
00091       END
```