LAPACK  3.6.1
LAPACK: Linear Algebra PACKage
subroutine slauu2 ( character  UPLO,
integer  N,
real, dimension( lda, * )  A,
integer  LDA,
integer  INFO 
)

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

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

Purpose:
 SLAUU2 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 REAL 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.
Date
September 2012

Definition at line 104 of file slauu2.f.

104 *
105 * -- LAPACK auxiliary routine (version 3.4.2) --
106 * -- LAPACK is a software package provided by Univ. of Tennessee, --
107 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
108 * September 2012
109 *
110 * .. Scalar Arguments ..
111  CHARACTER uplo
112  INTEGER info, lda, n
113 * ..
114 * .. Array Arguments ..
115  REAL a( lda, * )
116 * ..
117 *
118 * =====================================================================
119 *
120 * .. Parameters ..
121  REAL one
122  parameter ( one = 1.0e+0 )
123 * ..
124 * .. Local Scalars ..
125  LOGICAL upper
126  INTEGER i
127  REAL aii
128 * ..
129 * .. External Functions ..
130  LOGICAL lsame
131  REAL sdot
132  EXTERNAL lsame, sdot
133 * ..
134 * .. External Subroutines ..
135  EXTERNAL sgemv, sscal, xerbla
136 * ..
137 * .. Intrinsic Functions ..
138  INTRINSIC max
139 * ..
140 * .. Executable Statements ..
141 *
142 * Test the input parameters.
143 *
144  info = 0
145  upper = lsame( uplo, 'U' )
146  IF( .NOT.upper .AND. .NOT.lsame( uplo, 'L' ) ) THEN
147  info = -1
148  ELSE IF( n.LT.0 ) THEN
149  info = -2
150  ELSE IF( lda.LT.max( 1, n ) ) THEN
151  info = -4
152  END IF
153  IF( info.NE.0 ) THEN
154  CALL xerbla( 'SLAUU2', -info )
155  RETURN
156  END IF
157 *
158 * Quick return if possible
159 *
160  IF( n.EQ.0 )
161  $ RETURN
162 *
163  IF( upper ) THEN
164 *
165 * Compute the product U * U**T.
166 *
167  DO 10 i = 1, n
168  aii = a( i, i )
169  IF( i.LT.n ) THEN
170  a( i, i ) = sdot( n-i+1, a( i, i ), lda, a( i, i ), lda )
171  CALL sgemv( 'No transpose', i-1, n-i, one, a( 1, i+1 ),
172  $ lda, a( i, i+1 ), lda, aii, a( 1, i ), 1 )
173  ELSE
174  CALL sscal( i, aii, a( 1, i ), 1 )
175  END IF
176  10 CONTINUE
177 *
178  ELSE
179 *
180 * Compute the product L**T * L.
181 *
182  DO 20 i = 1, n
183  aii = a( i, i )
184  IF( i.LT.n ) THEN
185  a( i, i ) = sdot( n-i+1, a( i, i ), 1, a( i, i ), 1 )
186  CALL sgemv( 'Transpose', n-i, i-1, one, a( i+1, 1 ), lda,
187  $ a( i+1, i ), 1, aii, a( i, 1 ), lda )
188  ELSE
189  CALL sscal( i, aii, a( i, 1 ), lda )
190  END IF
191  20 CONTINUE
192  END IF
193 *
194  RETURN
195 *
196 * End of SLAUU2
197 *
real function sdot(N, SX, INCX, SY, INCY)
SDOT
Definition: sdot.f:53
subroutine xerbla(SRNAME, INFO)
XERBLA
Definition: xerbla.f:62
subroutine sgemv(TRANS, M, N, ALPHA, A, LDA, X, INCX, BETA, Y, INCY)
SGEMV
Definition: sgemv.f:158
subroutine sscal(N, SA, SX, INCX)
SSCAL
Definition: sscal.f:55
logical function lsame(CA, CB)
LSAME
Definition: lsame.f:55

Here is the call graph for this function:

Here is the caller graph for this function: