LAPACK 3.3.0
|
00001 SUBROUTINE DLACPY( 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 DOUBLE PRECISION A( LDA, * ), B( LDB, * ) 00014 * .. 00015 * 00016 * Purpose 00017 * ======= 00018 * 00019 * DLACPY 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) DOUBLE PRECISION array, dimension (LDA,N) 00038 * The m by n matrix A. If UPLO = 'U', only the upper triangle 00039 * or trapezoid is accessed; if UPLO = 'L', only the lower 00040 * triangle or trapezoid is accessed. 00041 * 00042 * LDA (input) INTEGER 00043 * The leading dimension of the array A. LDA >= max(1,M). 00044 * 00045 * B (output) DOUBLE PRECISION 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 ELSE IF( LSAME( UPLO, 'L' ) ) THEN 00072 DO 40 J = 1, N 00073 DO 30 I = J, M 00074 B( I, J ) = A( I, J ) 00075 30 CONTINUE 00076 40 CONTINUE 00077 ELSE 00078 DO 60 J = 1, N 00079 DO 50 I = 1, M 00080 B( I, J ) = A( I, J ) 00081 50 CONTINUE 00082 60 CONTINUE 00083 END IF 00084 RETURN 00085 * 00086 * End of DLACPY 00087 * 00088 END