version 1.5, 2010/08/07 13:18:07
|
version 1.14, 2012/12/14 14:22:36
|
Line 1
|
Line 1
|
|
*> \brief \b DLASQ3 checks for deflation, computes a shift and calls dqds. Used by sbdsqr. |
|
* |
|
* =========== DOCUMENTATION =========== |
|
* |
|
* Online html documentation available at |
|
* http://www.netlib.org/lapack/explore-html/ |
|
* |
|
*> \htmlonly |
|
*> Download DLASQ3 + dependencies |
|
*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/dlasq3.f"> |
|
*> [TGZ]</a> |
|
*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/dlasq3.f"> |
|
*> [ZIP]</a> |
|
*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dlasq3.f"> |
|
*> [TXT]</a> |
|
*> \endhtmlonly |
|
* |
|
* Definition: |
|
* =========== |
|
* |
|
* SUBROUTINE DLASQ3( I0, N0, Z, PP, DMIN, SIGMA, DESIG, QMAX, NFAIL, |
|
* ITER, NDIV, IEEE, TTYPE, DMIN1, DMIN2, DN, DN1, |
|
* DN2, G, TAU ) |
|
* |
|
* .. Scalar Arguments .. |
|
* LOGICAL IEEE |
|
* INTEGER I0, ITER, N0, NDIV, NFAIL, PP |
|
* DOUBLE PRECISION DESIG, DMIN, DMIN1, DMIN2, DN, DN1, DN2, G, |
|
* $ QMAX, SIGMA, TAU |
|
* .. |
|
* .. Array Arguments .. |
|
* DOUBLE PRECISION Z( * ) |
|
* .. |
|
* |
|
* |
|
*> \par Purpose: |
|
* ============= |
|
*> |
|
*> \verbatim |
|
*> |
|
*> DLASQ3 checks for deflation, computes a shift (TAU) and calls dqds. |
|
*> In case of failure it changes shifts, and tries again until output |
|
*> is positive. |
|
*> \endverbatim |
|
* |
|
* Arguments: |
|
* ========== |
|
* |
|
*> \param[in] I0 |
|
*> \verbatim |
|
*> I0 is INTEGER |
|
*> First index. |
|
*> \endverbatim |
|
*> |
|
*> \param[in,out] N0 |
|
*> \verbatim |
|
*> N0 is INTEGER |
|
*> Last index. |
|
*> \endverbatim |
|
*> |
|
*> \param[in] Z |
|
*> \verbatim |
|
*> Z is DOUBLE PRECISION array, dimension ( 4*N ) |
|
*> Z holds the qd array. |
|
*> \endverbatim |
|
*> |
|
*> \param[in,out] PP |
|
*> \verbatim |
|
*> PP is INTEGER |
|
*> PP=0 for ping, PP=1 for pong. |
|
*> PP=2 indicates that flipping was applied to the Z array |
|
*> and that the initial tests for deflation should not be |
|
*> performed. |
|
*> \endverbatim |
|
*> |
|
*> \param[out] DMIN |
|
*> \verbatim |
|
*> DMIN is DOUBLE PRECISION |
|
*> Minimum value of d. |
|
*> \endverbatim |
|
*> |
|
*> \param[out] SIGMA |
|
*> \verbatim |
|
*> SIGMA is DOUBLE PRECISION |
|
*> Sum of shifts used in current segment. |
|
*> \endverbatim |
|
*> |
|
*> \param[in,out] DESIG |
|
*> \verbatim |
|
*> DESIG is DOUBLE PRECISION |
|
*> Lower order part of SIGMA |
|
*> \endverbatim |
|
*> |
|
*> \param[in] QMAX |
|
*> \verbatim |
|
*> QMAX is DOUBLE PRECISION |
|
*> Maximum value of q. |
|
*> \endverbatim |
|
*> |
|
*> \param[out] NFAIL |
|
*> \verbatim |
|
*> NFAIL is INTEGER |
|
*> Number of times shift was too big. |
|
*> \endverbatim |
|
*> |
|
*> \param[out] ITER |
|
*> \verbatim |
|
*> ITER is INTEGER |
|
*> Number of iterations. |
|
*> \endverbatim |
|
*> |
|
*> \param[out] NDIV |
|
*> \verbatim |
|
*> NDIV is INTEGER |
|
*> Number of divisions. |
|
*> \endverbatim |
|
*> |
|
*> \param[in] IEEE |
|
*> \verbatim |
|
*> IEEE is LOGICAL |
|
*> Flag for IEEE or non IEEE arithmetic (passed to DLASQ5). |
|
*> \endverbatim |
|
*> |
|
*> \param[in,out] TTYPE |
|
*> \verbatim |
|
*> TTYPE is INTEGER |
|
*> Shift type. |
|
*> \endverbatim |
|
*> |
|
*> \param[in,out] DMIN1 |
|
*> \verbatim |
|
*> DMIN1 is DOUBLE PRECISION |
|
*> \endverbatim |
|
*> |
|
*> \param[in,out] DMIN2 |
|
*> \verbatim |
|
*> DMIN2 is DOUBLE PRECISION |
|
*> \endverbatim |
|
*> |
|
*> \param[in,out] DN |
|
*> \verbatim |
|
*> DN is DOUBLE PRECISION |
|
*> \endverbatim |
|
*> |
|
*> \param[in,out] DN1 |
|
*> \verbatim |
|
*> DN1 is DOUBLE PRECISION |
|
*> \endverbatim |
|
*> |
|
*> \param[in,out] DN2 |
|
*> \verbatim |
|
*> DN2 is DOUBLE PRECISION |
|
*> \endverbatim |
|
*> |
|
*> \param[in,out] G |
|
*> \verbatim |
|
*> G is DOUBLE PRECISION |
|
*> \endverbatim |
|
*> |
|
*> \param[in,out] TAU |
|
*> \verbatim |
|
*> TAU is DOUBLE PRECISION |
|
*> |
|
*> These are passed as arguments in order to save their values |
|
*> between calls to DLASQ3. |
|
*> \endverbatim |
|
* |
|
* Authors: |
|
* ======== |
|
* |
|
*> \author Univ. of Tennessee |
|
*> \author Univ. of California Berkeley |
|
*> \author Univ. of Colorado Denver |
|
*> \author NAG Ltd. |
|
* |
|
*> \date September 2012 |
|
* |
|
*> \ingroup auxOTHERcomputational |
|
* |
|
* ===================================================================== |
SUBROUTINE DLASQ3( I0, N0, Z, PP, DMIN, SIGMA, DESIG, QMAX, NFAIL, |
SUBROUTINE DLASQ3( I0, N0, Z, PP, DMIN, SIGMA, DESIG, QMAX, NFAIL, |
$ ITER, NDIV, IEEE, TTYPE, DMIN1, DMIN2, DN, DN1, |
$ ITER, NDIV, IEEE, TTYPE, DMIN1, DMIN2, DN, DN1, |
$ DN2, G, TAU ) |
$ DN2, G, TAU ) |
* |
* |
* -- LAPACK routine (version 3.2.2) -- |
* -- LAPACK computational routine (version 3.4.2) -- |
* |
|
* -- Contributed by Osni Marques of the Lawrence Berkeley National -- |
|
* -- Laboratory and Beresford Parlett of the Univ. of California at -- |
|
* -- Berkeley -- |
|
* -- June 2010 -- |
|
* |
|
* -- 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..-- |
|
* September 2012 |
* |
* |
* .. Scalar Arguments .. |
* .. Scalar Arguments .. |
LOGICAL IEEE |
LOGICAL IEEE |
Line 22
|
Line 197
|
DOUBLE PRECISION Z( * ) |
DOUBLE PRECISION Z( * ) |
* .. |
* .. |
* |
* |
* Purpose |
|
* ======= |
|
* |
|
* DLASQ3 checks for deflation, computes a shift (TAU) and calls dqds. |
|
* In case of failure it changes shifts, and tries again until output |
|
* is positive. |
|
* |
|
* Arguments |
|
* ========= |
|
* |
|
* I0 (input) INTEGER |
|
* First index. |
|
* |
|
* N0 (input/output) INTEGER |
|
* Last index. |
|
* |
|
* Z (input) DOUBLE PRECISION array, dimension ( 4*N ) |
|
* Z holds the qd array. |
|
* |
|
* PP (input/output) INTEGER |
|
* PP=0 for ping, PP=1 for pong. |
|
* PP=2 indicates that flipping was applied to the Z array |
|
* and that the initial tests for deflation should not be |
|
* performed. |
|
* |
|
* DMIN (output) DOUBLE PRECISION |
|
* Minimum value of d. |
|
* |
|
* SIGMA (output) DOUBLE PRECISION |
|
* Sum of shifts used in current segment. |
|
* |
|
* DESIG (input/output) DOUBLE PRECISION |
|
* Lower order part of SIGMA |
|
* |
|
* QMAX (input) DOUBLE PRECISION |
|
* Maximum value of q. |
|
* |
|
* NFAIL (output) INTEGER |
|
* Number of times shift was too big. |
|
* |
|
* ITER (output) INTEGER |
|
* Number of iterations. |
|
* |
|
* NDIV (output) INTEGER |
|
* Number of divisions. |
|
* |
|
* IEEE (input) LOGICAL |
|
* Flag for IEEE or non IEEE arithmetic (passed to DLASQ5). |
|
* |
|
* TTYPE (input/output) INTEGER |
|
* Shift type. |
|
* |
|
* DMIN1 (input/output) DOUBLE PRECISION |
|
* |
|
* DMIN2 (input/output) DOUBLE PRECISION |
|
* |
|
* DN (input/output) DOUBLE PRECISION |
|
* |
|
* DN1 (input/output) DOUBLE PRECISION |
|
* |
|
* DN2 (input/output) DOUBLE PRECISION |
|
* |
|
* G (input/output) DOUBLE PRECISION |
|
* |
|
* TAU (input/output) DOUBLE PRECISION |
|
* |
|
* These are passed as arguments in order to save their values |
|
* between calls to DLASQ3. |
|
* |
|
* ===================================================================== |
* ===================================================================== |
* |
* |
* .. Parameters .. |
* .. Parameters .. |
Line 161
|
Line 267
|
Z( NN-3 ) = Z( NN-7 ) |
Z( NN-3 ) = Z( NN-7 ) |
Z( NN-7 ) = S |
Z( NN-7 ) = S |
END IF |
END IF |
IF( Z( NN-5 ).GT.Z( NN-3 )*TOL2 ) THEN |
T = HALF*( ( Z( NN-7 )-Z( NN-3 ) )+Z( NN-5 ) ) |
T = HALF*( ( Z( NN-7 )-Z( NN-3 ) )+Z( NN-5 ) ) |
IF( Z( NN-5 ).GT.Z( NN-3 )*TOL2.AND.T.NE.ZERO ) THEN |
S = Z( NN-3 )*( Z( NN-5 ) / T ) |
S = Z( NN-3 )*( Z( NN-5 ) / T ) |
IF( S.LE.T ) THEN |
IF( S.LE.T ) THEN |
S = Z( NN-3 )*( Z( NN-5 ) / |
S = Z( NN-3 )*( Z( NN-5 ) / |
Line 225
|
Line 331
|
* |
* |
70 CONTINUE |
70 CONTINUE |
* |
* |
CALL DLASQ5( I0, N0, Z, PP, TAU, DMIN, DMIN1, DMIN2, DN, |
CALL DLASQ5( I0, N0, Z, PP, TAU, SIGMA, DMIN, DMIN1, DMIN2, DN, |
$ DN1, DN2, IEEE ) |
$ DN1, DN2, IEEE, EPS ) |
* |
* |
NDIV = NDIV + ( N0-I0+2 ) |
NDIV = NDIV + ( N0-I0+2 ) |
ITER = ITER + 1 |
ITER = ITER + 1 |
* |
* |
* Check status. |
* Check status. |
* |
* |
IF( DMIN.GE.ZERO .AND. DMIN1.GT.ZERO ) THEN |
IF( DMIN.GE.ZERO .AND. DMIN1.GE.ZERO ) THEN |
* |
* |
* Success. |
* Success. |
* |
* |