KTH framework for Nek5000 toolboxes; testing version  0.0.1
dlacpy.f
Go to the documentation of this file.
1  SUBROUTINE dlacpy( UPLO, M, N, A, LDA, B, LDB )
2 *
3 * -- LAPACK auxiliary routine (version 3.0) --
4 * Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,
5 * Courant Institute, Argonne National Lab, and Rice University
6 * February 29, 1992
7 *
8 * .. Scalar Arguments ..
9  CHARACTER UPLO
10  INTEGER LDA, LDB, M, N
11 * ..
12 * .. Array Arguments ..
13  DOUBLE PRECISION A( LDA, * ), B( LDB, * )
14 * ..
15 *
16 * Purpose
17 * =======
18 *
19 * DLACPY copies all or part of a two-dimensional matrix A to another
20 * matrix B.
21 *
22 * Arguments
23 * =========
24 *
25 * UPLO (input) CHARACTER*1
26 * Specifies the part of the matrix A to be copied to B.
27 * = 'U': Upper triangular part
28 * = 'L': Lower triangular part
29 * Otherwise: All of the matrix A
30 *
31 * M (input) INTEGER
32 * The number of rows of the matrix A. M >= 0.
33 *
34 * N (input) INTEGER
35 * The number of columns of the matrix A. N >= 0.
36 *
37 * A (input) DOUBLE PRECISION array, dimension (LDA,N)
38 * The m by n matrix A. If UPLO = 'U', only the upper triangle
39 * or trapezoid is accessed; if UPLO = 'L', only the lower
40 * triangle or trapezoid is accessed.
41 *
42 * LDA (input) INTEGER
43 * The leading dimension of the array A. LDA >= max(1,M).
44 *
45 * B (output) DOUBLE PRECISION array, dimension (LDB,N)
46 * On exit, B = A in the locations specified by UPLO.
47 *
48 * LDB (input) INTEGER
49 * The leading dimension of the array B. LDB >= max(1,M).
50 *
51 * =====================================================================
52 *
53 * .. Local Scalars ..
54  INTEGER I, J
55 * ..
56 * .. External Functions ..
57  LOGICAL LSAME
58  EXTERNAL lsame
59 * ..
60 * .. Intrinsic Functions ..
61  INTRINSIC min
62 * ..
63 * .. Executable Statements ..
64 *
65  IF( lsame( uplo, 'U' ) ) THEN
66  DO 20 j = 1, n
67  DO 10 i = 1, min( j, m )
68  b( i, j ) = a( i, j )
69  10 CONTINUE
70  20 CONTINUE
71  ELSE IF( lsame( uplo, 'L' ) ) THEN
72  DO 40 j = 1, n
73  DO 30 i = j, m
74  b( i, j ) = a( i, j )
75  30 CONTINUE
76  40 CONTINUE
77  ELSE
78  DO 60 j = 1, n
79  DO 50 i = 1, m
80  b( i, j ) = a( i, j )
81  50 CONTINUE
82  60 CONTINUE
83  END IF
84  RETURN
85 *
86 * End of DLACPY
87 *
88  END
subroutine dlacpy(UPLO, M, N, A, LDA, B, LDB)
Definition: dlacpy.f:2