PLASMA  2.4.5
PLASMA - Parallel Linear Algebra for Scalable Multi-core Architectures
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
dlauum.f
Go to the documentation of this file.
1  SUBROUTINE dlauum( UPLO, N, A, LDA, INFO )
2 *
3 * -- LAPACK auxiliary routine (version 3.2) --
4 * -- LAPACK is a software package provided by Univ. of Tennessee, --
5 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
6 * November 2006
7 *
8 * .. Scalar Arguments ..
9  CHARACTER uplo
10  INTEGER info, lda, n
11 * ..
12 * .. Array Arguments ..
13  DOUBLE PRECISION a( lda, * )
14 * ..
15 *
16 * Purpose
17 * =======
18 *
19 * DLAUUM computes the product U * U' or L' * L, where the triangular
20 * factor U or L is stored in the upper or lower triangular part of
21 * the array A.
22 *
23 * If UPLO = 'U' or 'u' then the upper triangle of the result is stored,
24 * overwriting the factor U in A.
25 * If UPLO = 'L' or 'l' then the lower triangle of the result is stored,
26 * overwriting the factor L in A.
27 *
28 * This is the blocked form of the algorithm, calling Level 3 BLAS.
29 *
30 * Arguments
31 * =========
32 *
33 * UPLO (input) CHARACTER*1
34 * Specifies whether the triangular factor stored in the array A
35 * is upper or lower triangular:
36 * = 'U': Upper triangular
37 * = 'L': Lower triangular
38 *
39 * N (input) INTEGER
40 * The order of the triangular factor U or L. N >= 0.
41 *
42 * A (input/output) DOUBLE PRECISION array, dimension (LDA,N)
43 * On entry, the triangular factor U or L.
44 * On exit, if UPLO = 'U', the upper triangle of A is
45 * overwritten with the upper triangle of the product U * U';
46 * if UPLO = 'L', the lower triangle of A is overwritten with
47 * the lower triangle of the product L' * L.
48 *
49 * LDA (input) INTEGER
50 * The leading dimension of the array A. LDA >= max(1,N).
51 *
52 * INFO (output) INTEGER
53 * = 0: successful exit
54 * < 0: if INFO = -k, the k-th argument had an illegal value
55 *
56 * =====================================================================
57 *
58 * .. Parameters ..
59  DOUBLE PRECISION one
60  parameter( one = 1.0d+0 )
61 * ..
62 * .. Local Scalars ..
63  LOGICAL upper
64  INTEGER i, ib, nb
65 * ..
66 * .. External Functions ..
67  LOGICAL lsame
68  INTEGER ilaenv
69  EXTERNAL lsame, ilaenv
70 * ..
71 * .. External Subroutines ..
72  EXTERNAL dgemm, dlauu2, dsyrk, dtrmm, xerbla
73 * ..
74 * .. Intrinsic Functions ..
75  INTRINSIC max, min
76 * ..
77 * .. Executable Statements ..
78 *
79 * Test the input parameters.
80 *
81  info = 0
82  upper = lsame( uplo, 'U' )
83  IF( .NOT.upper .AND. .NOT.lsame( uplo, 'L' ) ) THEN
84  info = -1
85  ELSE IF( n.LT.0 ) THEN
86  info = -2
87  ELSE IF( lda.LT.max( 1, n ) ) THEN
88  info = -4
89  END IF
90  IF( info.NE.0 ) THEN
91  CALL xerbla( 'DLAUUM', -info )
92  return
93  END IF
94 *
95 * Quick return if possible
96 *
97  IF( n.EQ.0 )
98  $ return
99 *
100 * Determine the block size for this environment.
101 *
102  nb = ilaenv( 1, 'DLAUUM', uplo, n, -1, -1, -1 )
103 *
104  IF( nb.LE.1 .OR. nb.GE.n ) THEN
105 *
106 * Use unblocked code
107 *
108  CALL dlauu2( uplo, n, a, lda, info )
109  ELSE
110 *
111 * Use blocked code
112 *
113  IF( upper ) THEN
114 *
115 * Compute the product U * U'.
116 *
117  DO 10 i = 1, n, nb
118  ib = min( nb, n-i+1 )
119  CALL dtrmm( 'Right', 'Upper', 'Transpose', 'Non-unit',
120  $ i-1, ib, one, a( i, i ), lda, a( 1, i ),
121  $ lda )
122  CALL dlauu2( 'Upper', ib, a( i, i ), lda, info )
123  IF( i+ib.LE.n ) THEN
124  CALL dgemm( 'No transpose', 'Transpose', i-1, ib,
125  $ n-i-ib+1, one, a( 1, i+ib ), lda,
126  $ a( i, i+ib ), lda, one, a( 1, i ), lda )
127  CALL dsyrk( 'Upper', 'No transpose', ib, n-i-ib+1,
128  $ one, a( i, i+ib ), lda, one, a( i, i ),
129  $ lda )
130  END IF
131  10 continue
132  ELSE
133 *
134 * Compute the product L' * L.
135 *
136  DO 20 i = 1, n, nb
137  ib = min( nb, n-i+1 )
138  CALL dtrmm( 'Left', 'Lower', 'Transpose', 'Non-unit', ib,
139  $ i-1, one, a( i, i ), lda, a( i, 1 ), lda )
140  CALL dlauu2( 'Lower', ib, a( i, i ), lda, info )
141  IF( i+ib.LE.n ) THEN
142  CALL dgemm( 'Transpose', 'No transpose', ib, i-1,
143  $ n-i-ib+1, one, a( i+ib, i ), lda,
144  $ a( i+ib, 1 ), lda, one, a( i, 1 ), lda )
145  CALL dsyrk( 'Lower', 'Transpose', ib, n-i-ib+1, one,
146  $ a( i+ib, i ), lda, one, a( i, i ), lda )
147  END IF
148  20 continue
149  END IF
150  END IF
151 *
152  return
153 *
154 * End of DLAUUM
155 *
156  END