--- rpl/lapack/lapack/dbdsvdx.f 2015/11/26 11:44:15 1.1 +++ rpl/lapack/lapack/dbdsvdx.f 2016/08/27 15:27:08 1.2 @@ -80,7 +80,7 @@ *> = 'L': B is lower bidiagonal. *> \endverbatim *> -*> \param[in] JOBXZ +*> \param[in] JOBZ *> \verbatim *> JOBZ is CHARACTER*1 *> = 'N': Compute singular values only; @@ -117,14 +117,16 @@ *> *> \param[in] VL *> \verbatim -*> VL is DOUBLE PRECISION -*> VL >=0. +*> VL is DOUBLE PRECISION +*> If RANGE='V', the lower bound of the interval to +*> be searched for singular values. VU > VL. +*> Not referenced if RANGE = 'A' or 'I'. *> \endverbatim *> *> \param[in] VU *> \verbatim *> VU is DOUBLE PRECISION -*> If RANGE='V', the lower and upper bounds of the interval to +*> If RANGE='V', the upper bound of the interval to *> be searched for singular values. VU > VL. *> Not referenced if RANGE = 'A' or 'I'. *> \endverbatim @@ -132,13 +134,17 @@ *> \param[in] IL *> \verbatim *> IL is INTEGER +*> If RANGE='I', the index of the +*> smallest singular value to be returned. +*> 1 <= IL <= IU <= min(M,N), if min(M,N) > 0. +*> Not referenced if RANGE = 'A' or 'V'. *> \endverbatim *> *> \param[in] IU *> \verbatim *> IU is INTEGER -*> If RANGE='I', the indices (in ascending order) of the -*> smallest and largest singular values to be returned. +*> If RANGE='I', the index of the +*> largest singular value to be returned. *> 1 <= IL <= IU <= min(M,N), if min(M,N) > 0. *> Not referenced if RANGE = 'A' or 'V'. *> \endverbatim @@ -190,7 +196,10 @@ *> If JOBZ = 'V', then if INFO = 0, the first NS elements of *> IWORK are zero. If INFO > 0, then IWORK contains the indices *> of the eigenvectors that failed to converge in DSTEVX. +*> \endverbatim *> +*> \param[out] INFO +*> \verbatim *> INFO is INTEGER *> = 0: successful exit *> < 0: if INFO = -i, the i-th argument had an illegal value @@ -209,7 +218,7 @@ *> \author Univ. of Colorado Denver *> \author NAG Ltd. * -*> \date November 2011 +*> \date June 2016 * *> \ingroup doubleOTHEReigen * @@ -217,7 +226,7 @@ SUBROUTINE DBDSVDX( UPLO, JOBZ, RANGE, N, D, E, VL, VU, IL, IU, $ NS, S, Z, LDZ, WORK, IWORK, INFO) * -* -- LAPACK driver routine (version 3.6.0) -- +* -- LAPACK driver routine (version 3.6.1) -- * -- LAPACK is a software package provided by Univ. of Tennessee, -- * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- * November 2016 @@ -371,7 +380,6 @@ IF( ABS( E( I ) ).LE.THRESH ) E( I ) = ZERO END DO IF( ABS( D( N ) ).LE.THRESH ) D( N ) = ZERO - E( N ) = ZERO * * Pointers for arrays used by DSTEVX. * @@ -398,7 +406,7 @@ * of the active submatrix. * RNGVX = 'I' - CALL DLASET( 'F', N*2, N+1, ZERO, ZERO, Z, LDZ ) + IF( WANTZ ) CALL DLASET( 'F', N*2, N+1, ZERO, ZERO, Z, LDZ ) ELSE IF( VALSV ) THEN * * Find singular values in a half-open interval. We aim @@ -418,7 +426,7 @@ IF( NS.EQ.0 ) THEN RETURN ELSE - CALL DLASET( 'F', N*2, NS, ZERO, ZERO, Z, LDZ ) + IF( WANTZ ) CALL DLASET( 'F', N*2, NS, ZERO, ZERO, Z, LDZ ) END IF ELSE IF( INDSV ) THEN * @@ -455,7 +463,7 @@ * IF( VLTGK.EQ.VUTGK ) VLTGK = VLTGK - TOL * - CALL DLASET( 'F', N*2, IU-IL+1, ZERO, ZERO, Z, LDZ ) + IF( WANTZ ) CALL DLASET( 'F', N*2, IU-IL+1, ZERO, ZERO, Z, LDZ) END IF * * Initialize variables and pointers for S, Z, and WORK. @@ -709,9 +717,11 @@ NRU = 0 NRV = 0 END IF !** NTGK.GT.0 **! - IF( IROWZ.LT.N*2 ) Z( 1:IROWZ-1, ICOLZ ) = ZERO + IF( IROWZ.LT.N*2 .AND. WANTZ ) THEN + Z( 1:IROWZ-1, ICOLZ ) = ZERO + END IF END DO !** IDPTR loop **! - IF( SPLIT ) THEN + IF( SPLIT .AND. WANTZ ) THEN * * Bring back eigenvector corresponding * to eigenvalue equal to zero. @@ -744,7 +754,7 @@ IF( K.NE.NS+1-I ) THEN S( K ) = S( NS+1-I ) S( NS+1-I ) = SMIN - CALL DSWAP( N*2, Z( 1,K ), 1, Z( 1,NS+1-I ), 1 ) + IF( WANTZ ) CALL DSWAP( N*2, Z( 1,K ), 1, Z( 1,NS+1-I ), 1 ) END IF END DO * @@ -754,7 +764,7 @@ K = IU - IL + 1 IF( K.LT.NS ) THEN S( K+1:NS ) = ZERO - Z( 1:N*2,K+1:NS ) = ZERO + IF( WANTZ ) Z( 1:N*2,K+1:NS ) = ZERO NS = K END IF END IF @@ -762,6 +772,7 @@ * Reorder Z: U = Z( 1:N,1:NS ), V = Z( N+1:N*2,1:NS ). * If B is a lower diagonal, swap U and V. * + IF( WANTZ ) THEN DO I = 1, NS CALL DCOPY( N*2, Z( 1,I ), 1, WORK, 1 ) IF( LOWER ) THEN @@ -772,6 +783,7 @@ CALL DCOPY( N, WORK( 1 ), 2, Z( N+1,I ), 1 ) END IF END DO + END IF * RETURN *