|
kusano |
2b45e8 |
SUBROUTINE DLAUUMF( UPLO, N, A, LDA, INFO )
|
|
kusano |
2b45e8 |
*
|
|
kusano |
2b45e8 |
* -- LAPACK auxiliary routine (version 3.0) --
|
|
kusano |
2b45e8 |
* Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,
|
|
kusano |
2b45e8 |
* Courant Institute, Argonne National Lab, and Rice University
|
|
kusano |
2b45e8 |
* February 29, 1992
|
|
kusano |
2b45e8 |
*
|
|
kusano |
2b45e8 |
* .. Scalar Arguments ..
|
|
kusano |
2b45e8 |
CHARACTER UPLO
|
|
kusano |
2b45e8 |
INTEGER INFO, LDA, N
|
|
kusano |
2b45e8 |
* ..
|
|
kusano |
2b45e8 |
* .. Array Arguments ..
|
|
kusano |
2b45e8 |
DOUBLE PRECISION A( LDA, * )
|
|
kusano |
2b45e8 |
* ..
|
|
kusano |
2b45e8 |
*
|
|
kusano |
2b45e8 |
* Purpose
|
|
kusano |
2b45e8 |
* =======
|
|
kusano |
2b45e8 |
*
|
|
kusano |
2b45e8 |
* DLAUUM computes the product U * U' or L' * L, where the triangular
|
|
kusano |
2b45e8 |
* factor U or L is stored in the upper or lower triangular part of
|
|
kusano |
2b45e8 |
* the array A.
|
|
kusano |
2b45e8 |
*
|
|
kusano |
2b45e8 |
* If UPLO = 'U' or 'u' then the upper triangle of the result is stored,
|
|
kusano |
2b45e8 |
* overwriting the factor U in A.
|
|
kusano |
2b45e8 |
* If UPLO = 'L' or 'l' then the lower triangle of the result is stored,
|
|
kusano |
2b45e8 |
* overwriting the factor L in A.
|
|
kusano |
2b45e8 |
*
|
|
kusano |
2b45e8 |
* This is the blocked form of the algorithm, calling Level 3 BLAS.
|
|
kusano |
2b45e8 |
*
|
|
kusano |
2b45e8 |
* Arguments
|
|
kusano |
2b45e8 |
* =========
|
|
kusano |
2b45e8 |
*
|
|
kusano |
2b45e8 |
* UPLO (input) CHARACTER*1
|
|
kusano |
2b45e8 |
* Specifies whether the triangular factor stored in the array A
|
|
kusano |
2b45e8 |
* is upper or lower triangular:
|
|
kusano |
2b45e8 |
* = 'U': Upper triangular
|
|
kusano |
2b45e8 |
* = 'L': Lower triangular
|
|
kusano |
2b45e8 |
*
|
|
kusano |
2b45e8 |
* N (input) INTEGER
|
|
kusano |
2b45e8 |
* The order of the triangular factor U or L. N >= 0.
|
|
kusano |
2b45e8 |
*
|
|
kusano |
2b45e8 |
* A (input/output) DOUBLE PRECISION array, dimension (LDA,N)
|
|
kusano |
2b45e8 |
* On entry, the triangular factor U or L.
|
|
kusano |
2b45e8 |
* On exit, if UPLO = 'U', the upper triangle of A is
|
|
kusano |
2b45e8 |
* overwritten with the upper triangle of the product U * U';
|
|
kusano |
2b45e8 |
* if UPLO = 'L', the lower triangle of A is overwritten with
|
|
kusano |
2b45e8 |
* the lower triangle of the product L' * L.
|
|
kusano |
2b45e8 |
*
|
|
kusano |
2b45e8 |
* LDA (input) INTEGER
|
|
kusano |
2b45e8 |
* The leading dimension of the array A. LDA >= max(1,N).
|
|
kusano |
2b45e8 |
*
|
|
kusano |
2b45e8 |
* INFO (output) INTEGER
|
|
kusano |
2b45e8 |
* = 0: successful exit
|
|
kusano |
2b45e8 |
* < 0: if INFO = -k, the k-th argument had an illegal value
|
|
kusano |
2b45e8 |
*
|
|
kusano |
2b45e8 |
* =====================================================================
|
|
kusano |
2b45e8 |
*
|
|
kusano |
2b45e8 |
* .. Parameters ..
|
|
kusano |
2b45e8 |
DOUBLE PRECISION ONE
|
|
kusano |
2b45e8 |
PARAMETER ( ONE = 1.0D+0 )
|
|
kusano |
2b45e8 |
* ..
|
|
kusano |
2b45e8 |
* .. Local Scalars ..
|
|
kusano |
2b45e8 |
LOGICAL UPPER
|
|
kusano |
2b45e8 |
INTEGER I, IB, NB
|
|
kusano |
2b45e8 |
* ..
|
|
kusano |
2b45e8 |
* .. External Functions ..
|
|
kusano |
2b45e8 |
LOGICAL LSAME
|
|
kusano |
2b45e8 |
EXTERNAL LSAME
|
|
kusano |
2b45e8 |
* ..
|
|
kusano |
2b45e8 |
* .. External Subroutines ..
|
|
kusano |
2b45e8 |
EXTERNAL DGEMM, DLAUU2, DSYRK, DTRMM, XERBLA
|
|
kusano |
2b45e8 |
* ..
|
|
kusano |
2b45e8 |
* .. Intrinsic Functions ..
|
|
kusano |
2b45e8 |
INTRINSIC MAX, MIN
|
|
kusano |
2b45e8 |
* ..
|
|
kusano |
2b45e8 |
* .. Executable Statements ..
|
|
kusano |
2b45e8 |
*
|
|
kusano |
2b45e8 |
* Test the input parameters.
|
|
kusano |
2b45e8 |
*
|
|
kusano |
2b45e8 |
INFO = 0
|
|
kusano |
2b45e8 |
UPPER = LSAME( UPLO, 'U' )
|
|
kusano |
2b45e8 |
IF( .NOT.UPPER .AND. .NOT.LSAME( UPLO, 'L' ) ) THEN
|
|
kusano |
2b45e8 |
INFO = -1
|
|
kusano |
2b45e8 |
ELSE IF( N.LT.0 ) THEN
|
|
kusano |
2b45e8 |
INFO = -2
|
|
kusano |
2b45e8 |
ELSE IF( LDA.LT.MAX( 1, N ) ) THEN
|
|
kusano |
2b45e8 |
INFO = -4
|
|
kusano |
2b45e8 |
END IF
|
|
kusano |
2b45e8 |
IF( INFO.NE.0 ) THEN
|
|
kusano |
2b45e8 |
CALL XERBLA( 'DLAUUM', -INFO )
|
|
kusano |
2b45e8 |
RETURN
|
|
kusano |
2b45e8 |
END IF
|
|
kusano |
2b45e8 |
*
|
|
kusano |
2b45e8 |
* Quick return if possible
|
|
kusano |
2b45e8 |
*
|
|
kusano |
2b45e8 |
IF( N.EQ.0 )
|
|
kusano |
2b45e8 |
$ RETURN
|
|
kusano |
2b45e8 |
*
|
|
kusano |
2b45e8 |
* Determine the block size for this environment.
|
|
kusano |
2b45e8 |
*
|
|
kusano |
2b45e8 |
NB = 128
|
|
kusano |
2b45e8 |
*
|
|
kusano |
2b45e8 |
IF( NB.LE.1 .OR. NB.GE.N ) THEN
|
|
kusano |
2b45e8 |
*
|
|
kusano |
2b45e8 |
* Use unblocked code
|
|
kusano |
2b45e8 |
*
|
|
kusano |
2b45e8 |
CALL DLAUU2( UPLO, N, A, LDA, INFO )
|
|
kusano |
2b45e8 |
ELSE
|
|
kusano |
2b45e8 |
*
|
|
kusano |
2b45e8 |
* Use blocked code
|
|
kusano |
2b45e8 |
*
|
|
kusano |
2b45e8 |
IF( UPPER ) THEN
|
|
kusano |
2b45e8 |
*
|
|
kusano |
2b45e8 |
* Compute the product U * U'.
|
|
kusano |
2b45e8 |
*
|
|
kusano |
2b45e8 |
DO 10 I = 1, N, NB
|
|
kusano |
2b45e8 |
IB = MIN( NB, N-I+1 )
|
|
kusano |
2b45e8 |
CALL DTRMM( 'Right', 'Upper', 'Transpose', 'Non-unit',
|
|
kusano |
2b45e8 |
$ I-1, IB, ONE, A( I, I ), LDA, A( 1, I ),
|
|
kusano |
2b45e8 |
$ LDA )
|
|
kusano |
2b45e8 |
CALL DLAUU2( 'Upper', IB, A( I, I ), LDA, INFO )
|
|
kusano |
2b45e8 |
IF( I+IB.LE.N ) THEN
|
|
kusano |
2b45e8 |
CALL DGEMM( 'No transpose', 'Transpose', I-1, IB,
|
|
kusano |
2b45e8 |
$ N-I-IB+1, ONE, A( 1, I+IB ), LDA,
|
|
kusano |
2b45e8 |
$ A( I, I+IB ), LDA, ONE, A( 1, I ), LDA )
|
|
kusano |
2b45e8 |
CALL DSYRK( 'Upper', 'No transpose', IB, N-I-IB+1,
|
|
kusano |
2b45e8 |
$ ONE, A( I, I+IB ), LDA, ONE, A( I, I ),
|
|
kusano |
2b45e8 |
$ LDA )
|
|
kusano |
2b45e8 |
END IF
|
|
kusano |
2b45e8 |
10 CONTINUE
|
|
kusano |
2b45e8 |
ELSE
|
|
kusano |
2b45e8 |
*
|
|
kusano |
2b45e8 |
* Compute the product L' * L.
|
|
kusano |
2b45e8 |
*
|
|
kusano |
2b45e8 |
DO 20 I = 1, N, NB
|
|
kusano |
2b45e8 |
IB = MIN( NB, N-I+1 )
|
|
kusano |
2b45e8 |
CALL DTRMM( 'Left', 'Lower', 'Transpose', 'Non-unit', IB,
|
|
kusano |
2b45e8 |
$ I-1, ONE, A( I, I ), LDA, A( I, 1 ), LDA )
|
|
kusano |
2b45e8 |
CALL DLAUU2( 'Lower', IB, A( I, I ), LDA, INFO )
|
|
kusano |
2b45e8 |
IF( I+IB.LE.N ) THEN
|
|
kusano |
2b45e8 |
CALL DGEMM( 'Transpose', 'No transpose', IB, I-1,
|
|
kusano |
2b45e8 |
$ N-I-IB+1, ONE, A( I+IB, I ), LDA,
|
|
kusano |
2b45e8 |
$ A( I+IB, 1 ), LDA, ONE, A( I, 1 ), LDA )
|
|
kusano |
2b45e8 |
CALL DSYRK( 'Lower', 'Transpose', IB, N-I-IB+1, ONE,
|
|
kusano |
2b45e8 |
$ A( I+IB, I ), LDA, ONE, A( I, I ), LDA )
|
|
kusano |
2b45e8 |
END IF
|
|
kusano |
2b45e8 |
20 CONTINUE
|
|
kusano |
2b45e8 |
END IF
|
|
kusano |
2b45e8 |
END IF
|
|
kusano |
2b45e8 |
*
|
|
kusano |
2b45e8 |
RETURN
|
|
kusano |
2b45e8 |
*
|
|
kusano |
2b45e8 |
* End of DLAUUM
|
|
kusano |
2b45e8 |
*
|
|
kusano |
2b45e8 |
END
|