LAPACK 3.11.0
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches

◆ dlauu2()

subroutine dlauu2 ( character  UPLO,
integer  N,
double precision, dimension( lda, * )  A,
integer  LDA,
integer  INFO 
)

DLAUU2 computes the product UUH or LHL, where U and L are upper or lower triangular matrices (unblocked algorithm).

Download DLAUU2 + dependencies [TGZ] [ZIP] [TXT]

Purpose:
 DLAUU2 computes the product U * U**T or L**T * L, where the triangular
 factor U or L is stored in the upper or lower triangular part of
 the array A.

 If UPLO = 'U' or 'u' then the upper triangle of the result is stored,
 overwriting the factor U in A.
 If UPLO = 'L' or 'l' then the lower triangle of the result is stored,
 overwriting the factor L in A.

 This is the unblocked form of the algorithm, calling Level 2 BLAS.
Parameters
[in]UPLO
          UPLO is CHARACTER*1
          Specifies whether the triangular factor stored in the array A
          is upper or lower triangular:
          = 'U':  Upper triangular
          = 'L':  Lower triangular
[in]N
          N is INTEGER
          The order of the triangular factor U or L.  N >= 0.
[in,out]A
          A is DOUBLE PRECISION array, dimension (LDA,N)
          On entry, the triangular factor U or L.
          On exit, if UPLO = 'U', the upper triangle of A is
          overwritten with the upper triangle of the product U * U**T;
          if UPLO = 'L', the lower triangle of A is overwritten with
          the lower triangle of the product L**T * L.
[in]LDA
          LDA is INTEGER
          The leading dimension of the array A.  LDA >= max(1,N).
[out]INFO
          INFO is INTEGER
          = 0: successful exit
          < 0: if INFO = -k, the k-th argument had an illegal value
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.

Definition at line 101 of file dlauu2.f.

102*
103* -- LAPACK auxiliary routine --
104* -- LAPACK is a software package provided by Univ. of Tennessee, --
105* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
106*
107* .. Scalar Arguments ..
108 CHARACTER UPLO
109 INTEGER INFO, LDA, N
110* ..
111* .. Array Arguments ..
112 DOUBLE PRECISION A( LDA, * )
113* ..
114*
115* =====================================================================
116*
117* .. Parameters ..
118 DOUBLE PRECISION ONE
119 parameter( one = 1.0d+0 )
120* ..
121* .. Local Scalars ..
122 LOGICAL UPPER
123 INTEGER I
124 DOUBLE PRECISION AII
125* ..
126* .. External Functions ..
127 LOGICAL LSAME
128 DOUBLE PRECISION DDOT
129 EXTERNAL lsame, ddot
130* ..
131* .. External Subroutines ..
132 EXTERNAL dgemv, dscal, xerbla
133* ..
134* .. Intrinsic Functions ..
135 INTRINSIC max
136* ..
137* .. Executable Statements ..
138*
139* Test the input parameters.
140*
141 info = 0
142 upper = lsame( uplo, 'U' )
143 IF( .NOT.upper .AND. .NOT.lsame( uplo, 'L' ) ) THEN
144 info = -1
145 ELSE IF( n.LT.0 ) THEN
146 info = -2
147 ELSE IF( lda.LT.max( 1, n ) ) THEN
148 info = -4
149 END IF
150 IF( info.NE.0 ) THEN
151 CALL xerbla( 'DLAUU2', -info )
152 RETURN
153 END IF
154*
155* Quick return if possible
156*
157 IF( n.EQ.0 )
158 $ RETURN
159*
160 IF( upper ) THEN
161*
162* Compute the product U * U**T.
163*
164 DO 10 i = 1, n
165 aii = a( i, i )
166 IF( i.LT.n ) THEN
167 a( i, i ) = ddot( n-i+1, a( i, i ), lda, a( i, i ), lda )
168 CALL dgemv( 'No transpose', i-1, n-i, one, a( 1, i+1 ),
169 $ lda, a( i, i+1 ), lda, aii, a( 1, i ), 1 )
170 ELSE
171 CALL dscal( i, aii, a( 1, i ), 1 )
172 END IF
173 10 CONTINUE
174*
175 ELSE
176*
177* Compute the product L**T * L.
178*
179 DO 20 i = 1, n
180 aii = a( i, i )
181 IF( i.LT.n ) THEN
182 a( i, i ) = ddot( n-i+1, a( i, i ), 1, a( i, i ), 1 )
183 CALL dgemv( 'Transpose', n-i, i-1, one, a( i+1, 1 ), lda,
184 $ a( i+1, i ), 1, aii, a( i, 1 ), lda )
185 ELSE
186 CALL dscal( i, aii, a( i, 1 ), lda )
187 END IF
188 20 CONTINUE
189 END IF
190*
191 RETURN
192*
193* End of DLAUU2
194*
subroutine xerbla(SRNAME, INFO)
XERBLA
Definition: xerbla.f:60
logical function lsame(CA, CB)
LSAME
Definition: lsame.f:53
double precision function ddot(N, DX, INCX, DY, INCY)
DDOT
Definition: ddot.f:82
subroutine dscal(N, DA, DX, INCX)
DSCAL
Definition: dscal.f:79
subroutine dgemv(TRANS, M, N, ALPHA, A, LDA, X, INCX, BETA, Y, INCY)
DGEMV
Definition: dgemv.f:156
Here is the call graph for this function:
Here is the caller graph for this function: