version 1.10, 2012/08/22 09:48:12
|
version 1.19, 2023/08/07 08:38:47
|
Line 2
|
Line 2
|
* |
* |
* =========== DOCUMENTATION =========== |
* =========== DOCUMENTATION =========== |
* |
* |
* Online html documentation available at |
* Online html documentation available at |
* http://www.netlib.org/lapack/explore-html/ |
* http://www.netlib.org/lapack/explore-html/ |
* |
* |
*> \htmlonly |
*> \htmlonly |
*> Download DBDSQR + dependencies |
*> Download DBDSQR + dependencies |
*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/dbdsqr.f"> |
*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/dbdsqr.f"> |
*> [TGZ]</a> |
*> [TGZ]</a> |
*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/dbdsqr.f"> |
*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/dbdsqr.f"> |
*> [ZIP]</a> |
*> [ZIP]</a> |
*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dbdsqr.f"> |
*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dbdsqr.f"> |
*> [TXT]</a> |
*> [TXT]</a> |
*> \endhtmlonly |
*> \endhtmlonly |
* |
* |
* Definition: |
* Definition: |
* =========== |
* =========== |
* |
* |
* SUBROUTINE DBDSQR( UPLO, N, NCVT, NRU, NCC, D, E, VT, LDVT, U, |
* SUBROUTINE DBDSQR( UPLO, N, NCVT, NRU, NCC, D, E, VT, LDVT, U, |
* LDU, C, LDC, WORK, INFO ) |
* LDU, C, LDC, WORK, INFO ) |
* |
* |
* .. Scalar Arguments .. |
* .. Scalar Arguments .. |
* CHARACTER UPLO |
* CHARACTER UPLO |
* INTEGER INFO, LDC, LDU, LDVT, N, NCC, NCVT, NRU |
* INTEGER INFO, LDC, LDU, LDVT, N, NCC, NCVT, NRU |
Line 29
|
Line 29
|
* DOUBLE PRECISION C( LDC, * ), D( * ), E( * ), U( LDU, * ), |
* DOUBLE PRECISION C( LDC, * ), D( * ), E( * ), U( LDU, * ), |
* $ VT( LDVT, * ), WORK( * ) |
* $ VT( LDVT, * ), WORK( * ) |
* .. |
* .. |
* |
* |
* |
* |
*> \par Purpose: |
*> \par Purpose: |
* ============= |
* ============= |
Line 40
|
Line 40
|
*> left singular vectors from the singular value decomposition (SVD) of |
*> left singular vectors from the singular value decomposition (SVD) of |
*> a real N-by-N (upper or lower) bidiagonal matrix B using the implicit |
*> a real N-by-N (upper or lower) bidiagonal matrix B using the implicit |
*> zero-shift QR algorithm. The SVD of B has the form |
*> zero-shift QR algorithm. The SVD of B has the form |
*> |
*> |
*> B = Q * S * P**T |
*> B = Q * S * P**T |
*> |
*> |
*> where S is the diagonal matrix of singular values, Q is an orthogonal |
*> where S is the diagonal matrix of singular values, Q is an orthogonal |
*> matrix of left singular vectors, and P is an orthogonal matrix of |
*> matrix of left singular vectors, and P is an orthogonal matrix of |
*> right singular vectors. If left singular vectors are requested, this |
*> right singular vectors. If left singular vectors are requested, this |
Line 113
|
Line 113
|
*> \verbatim |
*> \verbatim |
*> E is DOUBLE PRECISION array, dimension (N-1) |
*> E is DOUBLE PRECISION array, dimension (N-1) |
*> On entry, the N-1 offdiagonal elements of the bidiagonal |
*> On entry, the N-1 offdiagonal elements of the bidiagonal |
*> matrix B. |
*> matrix B. |
*> On exit, if INFO = 0, E is destroyed; if INFO > 0, D and E |
*> On exit, if INFO = 0, E is destroyed; if INFO > 0, D and E |
*> will contain the diagonal and superdiagonal elements of a |
*> will contain the diagonal and superdiagonal elements of a |
*> bidiagonal matrix orthogonally equivalent to the one given |
*> bidiagonal matrix orthogonally equivalent to the one given |
Line 166
|
Line 166
|
*> |
*> |
*> \param[out] WORK |
*> \param[out] WORK |
*> \verbatim |
*> \verbatim |
*> WORK is DOUBLE PRECISION array, dimension (4*N) |
*> WORK is DOUBLE PRECISION array, dimension (4*(N-1)) |
*> \endverbatim |
*> \endverbatim |
*> |
*> |
*> \param[out] INFO |
*> \param[out] INFO |
Line 179
|
Line 179
|
*> = 1, a split was marked by a positive value in E |
*> = 1, a split was marked by a positive value in E |
*> = 2, current block of Z not diagonalized after 30*N |
*> = 2, current block of Z not diagonalized after 30*N |
*> iterations (in inner while loop) |
*> iterations (in inner while loop) |
*> = 3, termination criterion of outer while loop not met |
*> = 3, termination criterion of outer while loop not met |
*> (program created more than N unreduced blocks) |
*> (program created more than N unreduced blocks) |
*> else NCVT = NRU = NCC = 0, |
*> else NCVT = NRU = NCC = 0, |
*> the algorithm did not converge; D and E contain the |
*> the algorithm did not converge; D and E contain the |
Line 212
|
Line 212
|
*> algorithm through its inner loop. The algorithms stops |
*> algorithm through its inner loop. The algorithms stops |
*> (and so fails to converge) if the number of passes |
*> (and so fails to converge) if the number of passes |
*> through the inner loop exceeds MAXITR*N**2. |
*> through the inner loop exceeds MAXITR*N**2. |
|
*> |
|
*> \endverbatim |
|
* |
|
*> \par Note: |
|
* =========== |
|
*> |
|
*> \verbatim |
|
*> Bug report from Cezary Dendek. |
|
*> On March 23rd 2017, the INTEGER variable MAXIT = MAXITR*N**2 is |
|
*> removed since it can overflow pretty easily (for N larger or equal |
|
*> than 18,919). We instead use MAXITDIVN = MAXITR*N. |
*> \endverbatim |
*> \endverbatim |
* |
* |
* Authors: |
* Authors: |
* ======== |
* ======== |
* |
* |
*> \author Univ. of Tennessee |
*> \author Univ. of Tennessee |
*> \author Univ. of California Berkeley |
*> \author Univ. of California Berkeley |
*> \author Univ. of Colorado Denver |
*> \author Univ. of Colorado Denver |
*> \author NAG Ltd. |
*> \author NAG Ltd. |
* |
|
*> \date November 2011 |
|
* |
* |
*> \ingroup auxOTHERcomputational |
*> \ingroup auxOTHERcomputational |
* |
* |
Line 230
|
Line 239
|
SUBROUTINE DBDSQR( UPLO, N, NCVT, NRU, NCC, D, E, VT, LDVT, U, |
SUBROUTINE DBDSQR( UPLO, N, NCVT, NRU, NCC, D, E, VT, LDVT, U, |
$ LDU, C, LDC, WORK, INFO ) |
$ LDU, C, LDC, WORK, INFO ) |
* |
* |
* -- LAPACK computational routine (version 3.4.0) -- |
* -- LAPACK computational routine -- |
* -- LAPACK is a software package provided by Univ. of Tennessee, -- |
* -- LAPACK is a software package provided by Univ. of Tennessee, -- |
* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- |
* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- |
* November 2011 |
|
* |
* |
* .. Scalar Arguments .. |
* .. Scalar Arguments .. |
CHARACTER UPLO |
CHARACTER UPLO |
Line 266
|
Line 274
|
* .. |
* .. |
* .. Local Scalars .. |
* .. Local Scalars .. |
LOGICAL LOWER, ROTATE |
LOGICAL LOWER, ROTATE |
INTEGER I, IDIR, ISUB, ITER, J, LL, LLL, M, MAXIT, NM1, |
INTEGER I, IDIR, ISUB, ITER, ITERDIVN, J, LL, LLL, M, |
$ NM12, NM13, OLDLL, OLDM |
$ MAXITDIVN, NM1, NM12, NM13, OLDLL, OLDM |
DOUBLE PRECISION ABSE, ABSS, COSL, COSR, CS, EPS, F, G, H, MU, |
DOUBLE PRECISION ABSE, ABSS, COSL, COSR, CS, EPS, F, G, H, MU, |
$ OLDCS, OLDSN, R, SHIFT, SIGMN, SIGMX, SINL, |
$ OLDCS, OLDSN, R, SHIFT, SIGMN, SIGMX, SINL, |
$ SINR, SLL, SMAX, SMIN, SMINL, SMINOA, |
$ SINR, SLL, SMAX, SMIN, SMINL, SMINOA, |
Line 329
|
Line 337
|
CALL DLASQ1( N, D, E, WORK, INFO ) |
CALL DLASQ1( N, D, E, WORK, INFO ) |
* |
* |
* If INFO equals 2, dqds didn't finish, try to finish |
* If INFO equals 2, dqds didn't finish, try to finish |
* |
* |
IF( INFO .NE. 2 ) RETURN |
IF( INFO .NE. 2 ) RETURN |
INFO = 0 |
INFO = 0 |
END IF |
END IF |
Line 400
|
Line 408
|
40 CONTINUE |
40 CONTINUE |
50 CONTINUE |
50 CONTINUE |
SMINOA = SMINOA / SQRT( DBLE( N ) ) |
SMINOA = SMINOA / SQRT( DBLE( N ) ) |
THRESH = MAX( TOL*SMINOA, MAXITR*N*N*UNFL ) |
THRESH = MAX( TOL*SMINOA, MAXITR*(N*(N*UNFL)) ) |
ELSE |
ELSE |
* |
* |
* Absolute accuracy desired |
* Absolute accuracy desired |
* |
* |
THRESH = MAX( ABS( TOL )*SMAX, MAXITR*N*N*UNFL ) |
THRESH = MAX( ABS( TOL )*SMAX, MAXITR*(N*(N*UNFL)) ) |
END IF |
END IF |
* |
* |
* Prepare for main iteration loop for the singular values |
* Prepare for main iteration loop for the singular values |
* (MAXIT is the maximum number of passes through the inner |
* (MAXIT is the maximum number of passes through the inner |
* loop permitted before nonconvergence signalled.) |
* loop permitted before nonconvergence signalled.) |
* |
* |
MAXIT = MAXITR*N*N |
MAXITDIVN = MAXITR*N |
ITER = 0 |
ITERDIVN = 0 |
|
ITER = -1 |
OLDLL = -1 |
OLDLL = -1 |
OLDM = -1 |
OLDM = -1 |
* |
* |
Line 429
|
Line 438
|
* |
* |
IF( M.LE.1 ) |
IF( M.LE.1 ) |
$ GO TO 160 |
$ GO TO 160 |
IF( ITER.GT.MAXIT ) |
* |
$ GO TO 200 |
IF( ITER.GE.N ) THEN |
|
ITER = ITER - N |
|
ITERDIVN = ITERDIVN + 1 |
|
IF( ITERDIVN.GE.MAXITDIVN ) |
|
$ GO TO 200 |
|
END IF |
* |
* |
* Find diagonal block of matrix to work on |
* Find diagonal block of matrix to work on |
* |
* |