ScaLAPACK 2.1  2.1 ScaLAPACK: Scalable Linear Algebra PACKage
ilacpy.f
Go to the documentation of this file.
1  SUBROUTINE ilacpy( UPLO, M, N, A, LDA, B, LDB )
2 *
3 * -- ScaLAPACK tools routine (version 1.7) --
4 * University of Tennessee, Knoxville, Oak Ridge National Laboratory,
5 * and University of California, Berkeley.
6 * May 1, 1997
7 *
8 * .. Scalar Arguments ..
9  CHARACTER UPLO
10  INTEGER LDA, LDB, M, N
11 * ..
12 * .. Array Arguments ..
13  INTEGER A( LDA, * ), B( LDB, * )
14 * ..
15 *
16 * Purpose
17 * =======
18 *
19 * ILACPY copies all or part of a local array A to another array B.
20 *
21 * Arguments
22 * =========
23 *
24 * UPLO (local input) CHARACTER*1
25 * Specifies the part of the array A to be copied to B.
26 * = 'U': Upper triangular part
27 * = 'L': Lower triangular part
28 * Otherwise: All of the array A
29 *
30 * M (local input) INTEGER
31 * The number of rows of the array A. M >= 0.
32 *
33 * N (local input) INTEGER
34 * The number of columns of the array A. N >= 0.
35 *
36 * A (local input) INTEGER
37 * Array, dimension (LDA,N), the m by n array A.
38 * If UPLO = 'U', only the upper triangle or trapezoid is
39 * accessed; if UPLO = 'L', only the lower triangle or trapezoid
40 * is accessed.
41 *
42 * LDA (local input) INTEGER
43 * The leading dimension of the array A. LDA >= max(1,M).
44 *
45 * B (local output) INTEGER
46 * Array, dimension (LDB,N), on exit, B = A in the locations
47 * specified by UPLO.
48 *
49 * LDB (local input) INTEGER
50 * The leading dimension of the array B. LDB >= max(1,M).
51 *
52 * =====================================================================
53 *
54 * .. Local Scalars ..
55  INTEGER I, J
56 * ..
57 * .. External Functions ..
58  LOGICAL LSAME
59  EXTERNAL lsame
60 * ..
61 * .. Intrinsic Functions ..
62  INTRINSIC min
63 * ..
64 * .. Executable Statements ..
65 *
66  IF( lsame( uplo, 'U' ) ) THEN
67  DO 20 j = 1, n
68  DO 10 i = 1, min( j, m )
69  b( i, j ) = a( i, j )
70  10 CONTINUE
71  20 CONTINUE
72  ELSE IF( lsame( uplo, 'L' ) ) THEN
73  DO 40 j = 1, n
74  DO 30 i = j, m
75  b( i, j ) = a( i, j )
76  30 CONTINUE
77  40 CONTINUE
78  ELSE
79  DO 60 j = 1, n
80  DO 50 i = 1, m
81  b( i, j ) = a( i, j )
82  50 CONTINUE
83  60 CONTINUE
84  END IF
85  RETURN
86 *
87 * End of ILACPY
88 *
89  END
ilacpy
subroutine ilacpy(UPLO, M, N, A, LDA, B, LDB)
Definition: ilacpy.f:2
min
#define min(A, B)
Definition: pcgemr.c:181