--- rpl/lapack/lapack/dlasd7.f 2010/01/26 15:22:45 1.1.1.1
+++ rpl/lapack/lapack/dlasd7.f 2017/06/17 10:53:57 1.15
@@ -1,12 +1,289 @@
+*> \brief \b DLASD7 merges the two sets of singular values together into a single sorted set. Then it tries to deflate the size of the problem. Used by sbdsdc.
+*
+* =========== DOCUMENTATION ===========
+*
+* Online html documentation available at
+* http://www.netlib.org/lapack/explore-html/
+*
+*> \htmlonly
+*> Download DLASD7 + dependencies
+*>
+*> [TGZ]
+*>
+*> [ZIP]
+*>
+*> [TXT]
+*> \endhtmlonly
+*
+* Definition:
+* ===========
+*
+* SUBROUTINE DLASD7( ICOMPQ, NL, NR, SQRE, K, D, Z, ZW, VF, VFW, VL,
+* VLW, ALPHA, BETA, DSIGMA, IDX, IDXP, IDXQ,
+* PERM, GIVPTR, GIVCOL, LDGCOL, GIVNUM, LDGNUM,
+* C, S, INFO )
+*
+* .. Scalar Arguments ..
+* INTEGER GIVPTR, ICOMPQ, INFO, K, LDGCOL, LDGNUM, NL,
+* $ NR, SQRE
+* DOUBLE PRECISION ALPHA, BETA, C, S
+* ..
+* .. Array Arguments ..
+* INTEGER GIVCOL( LDGCOL, * ), IDX( * ), IDXP( * ),
+* $ IDXQ( * ), PERM( * )
+* DOUBLE PRECISION D( * ), DSIGMA( * ), GIVNUM( LDGNUM, * ),
+* $ VF( * ), VFW( * ), VL( * ), VLW( * ), Z( * ),
+* $ ZW( * )
+* ..
+*
+*
+*> \par Purpose:
+* =============
+*>
+*> \verbatim
+*>
+*> DLASD7 merges the two sets of singular values together into a single
+*> sorted set. Then it tries to deflate the size of the problem. There
+*> are two ways in which deflation can occur: when two or more singular
+*> values are close together or if there is a tiny entry in the Z
+*> vector. For each such occurrence the order of the related
+*> secular equation problem is reduced by one.
+*>
+*> DLASD7 is called from DLASD6.
+*> \endverbatim
+*
+* Arguments:
+* ==========
+*
+*> \param[in] ICOMPQ
+*> \verbatim
+*> ICOMPQ is INTEGER
+*> Specifies whether singular vectors are to be computed
+*> in compact form, as follows:
+*> = 0: Compute singular values only.
+*> = 1: Compute singular vectors of upper
+*> bidiagonal matrix in compact form.
+*> \endverbatim
+*>
+*> \param[in] NL
+*> \verbatim
+*> NL is INTEGER
+*> The row dimension of the upper block. NL >= 1.
+*> \endverbatim
+*>
+*> \param[in] NR
+*> \verbatim
+*> NR is INTEGER
+*> The row dimension of the lower block. NR >= 1.
+*> \endverbatim
+*>
+*> \param[in] SQRE
+*> \verbatim
+*> SQRE is INTEGER
+*> = 0: the lower block is an NR-by-NR square matrix.
+*> = 1: the lower block is an NR-by-(NR+1) rectangular matrix.
+*>
+*> The bidiagonal matrix has
+*> N = NL + NR + 1 rows and
+*> M = N + SQRE >= N columns.
+*> \endverbatim
+*>
+*> \param[out] K
+*> \verbatim
+*> K is INTEGER
+*> Contains the dimension of the non-deflated matrix, this is
+*> the order of the related secular equation. 1 <= K <=N.
+*> \endverbatim
+*>
+*> \param[in,out] D
+*> \verbatim
+*> D is DOUBLE PRECISION array, dimension ( N )
+*> On entry D contains the singular values of the two submatrices
+*> to be combined. On exit D contains the trailing (N-K) updated
+*> singular values (those which were deflated) sorted into
+*> increasing order.
+*> \endverbatim
+*>
+*> \param[out] Z
+*> \verbatim
+*> Z is DOUBLE PRECISION array, dimension ( M )
+*> On exit Z contains the updating row vector in the secular
+*> equation.
+*> \endverbatim
+*>
+*> \param[out] ZW
+*> \verbatim
+*> ZW is DOUBLE PRECISION array, dimension ( M )
+*> Workspace for Z.
+*> \endverbatim
+*>
+*> \param[in,out] VF
+*> \verbatim
+*> VF is DOUBLE PRECISION array, dimension ( M )
+*> On entry, VF(1:NL+1) contains the first components of all
+*> right singular vectors of the upper block; and VF(NL+2:M)
+*> contains the first components of all right singular vectors
+*> of the lower block. On exit, VF contains the first components
+*> of all right singular vectors of the bidiagonal matrix.
+*> \endverbatim
+*>
+*> \param[out] VFW
+*> \verbatim
+*> VFW is DOUBLE PRECISION array, dimension ( M )
+*> Workspace for VF.
+*> \endverbatim
+*>
+*> \param[in,out] VL
+*> \verbatim
+*> VL is DOUBLE PRECISION array, dimension ( M )
+*> On entry, VL(1:NL+1) contains the last components of all
+*> right singular vectors of the upper block; and VL(NL+2:M)
+*> contains the last components of all right singular vectors
+*> of the lower block. On exit, VL contains the last components
+*> of all right singular vectors of the bidiagonal matrix.
+*> \endverbatim
+*>
+*> \param[out] VLW
+*> \verbatim
+*> VLW is DOUBLE PRECISION array, dimension ( M )
+*> Workspace for VL.
+*> \endverbatim
+*>
+*> \param[in] ALPHA
+*> \verbatim
+*> ALPHA is DOUBLE PRECISION
+*> Contains the diagonal element associated with the added row.
+*> \endverbatim
+*>
+*> \param[in] BETA
+*> \verbatim
+*> BETA is DOUBLE PRECISION
+*> Contains the off-diagonal element associated with the added
+*> row.
+*> \endverbatim
+*>
+*> \param[out] DSIGMA
+*> \verbatim
+*> DSIGMA is DOUBLE PRECISION array, dimension ( N )
+*> Contains a copy of the diagonal elements (K-1 singular values
+*> and one zero) in the secular equation.
+*> \endverbatim
+*>
+*> \param[out] IDX
+*> \verbatim
+*> IDX is INTEGER array, dimension ( N )
+*> This will contain the permutation used to sort the contents of
+*> D into ascending order.
+*> \endverbatim
+*>
+*> \param[out] IDXP
+*> \verbatim
+*> IDXP is INTEGER array, dimension ( N )
+*> This will contain the permutation used to place deflated
+*> values of D at the end of the array. On output IDXP(2:K)
+*> points to the nondeflated D-values and IDXP(K+1:N)
+*> points to the deflated singular values.
+*> \endverbatim
+*>
+*> \param[in] IDXQ
+*> \verbatim
+*> IDXQ is INTEGER array, dimension ( N )
+*> This contains the permutation which separately sorts the two
+*> sub-problems in D into ascending order. Note that entries in
+*> the first half of this permutation must first be moved one
+*> position backward; and entries in the second half
+*> must first have NL+1 added to their values.
+*> \endverbatim
+*>
+*> \param[out] PERM
+*> \verbatim
+*> PERM is INTEGER array, dimension ( N )
+*> The permutations (from deflation and sorting) to be applied
+*> to each singular block. Not referenced if ICOMPQ = 0.
+*> \endverbatim
+*>
+*> \param[out] GIVPTR
+*> \verbatim
+*> GIVPTR is INTEGER
+*> The number of Givens rotations which took place in this
+*> subproblem. Not referenced if ICOMPQ = 0.
+*> \endverbatim
+*>
+*> \param[out] GIVCOL
+*> \verbatim
+*> GIVCOL is INTEGER array, dimension ( LDGCOL, 2 )
+*> Each pair of numbers indicates a pair of columns to take place
+*> in a Givens rotation. Not referenced if ICOMPQ = 0.
+*> \endverbatim
+*>
+*> \param[in] LDGCOL
+*> \verbatim
+*> LDGCOL is INTEGER
+*> The leading dimension of GIVCOL, must be at least N.
+*> \endverbatim
+*>
+*> \param[out] GIVNUM
+*> \verbatim
+*> GIVNUM is DOUBLE PRECISION array, dimension ( LDGNUM, 2 )
+*> Each number indicates the C or S value to be used in the
+*> corresponding Givens rotation. Not referenced if ICOMPQ = 0.
+*> \endverbatim
+*>
+*> \param[in] LDGNUM
+*> \verbatim
+*> LDGNUM is INTEGER
+*> The leading dimension of GIVNUM, must be at least N.
+*> \endverbatim
+*>
+*> \param[out] C
+*> \verbatim
+*> C is DOUBLE PRECISION
+*> C contains garbage if SQRE =0 and the C-value of a Givens
+*> rotation related to the right null space if SQRE = 1.
+*> \endverbatim
+*>
+*> \param[out] S
+*> \verbatim
+*> S is DOUBLE PRECISION
+*> S contains garbage if SQRE =0 and the S-value of a Givens
+*> rotation related to the right null space if SQRE = 1.
+*> \endverbatim
+*>
+*> \param[out] INFO
+*> \verbatim
+*> INFO is INTEGER
+*> = 0: successful exit.
+*> < 0: if INFO = -i, the i-th argument had an illegal value.
+*> \endverbatim
+*
+* Authors:
+* ========
+*
+*> \author Univ. of Tennessee
+*> \author Univ. of California Berkeley
+*> \author Univ. of Colorado Denver
+*> \author NAG Ltd.
+*
+*> \date December 2016
+*
+*> \ingroup OTHERauxiliary
+*
+*> \par Contributors:
+* ==================
+*>
+*> Ming Gu and Huan Ren, Computer Science Division, University of
+*> California at Berkeley, USA
+*>
+* =====================================================================
SUBROUTINE DLASD7( ICOMPQ, NL, NR, SQRE, K, D, Z, ZW, VF, VFW, VL,
$ VLW, ALPHA, BETA, DSIGMA, IDX, IDXP, IDXQ,
$ PERM, GIVPTR, GIVCOL, LDGCOL, GIVNUM, LDGNUM,
$ C, S, INFO )
*
-* -- LAPACK auxiliary routine (version 3.2) --
+* -- LAPACK auxiliary routine (version 3.7.0) --
* -- LAPACK is a software package provided by Univ. of Tennessee, --
* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
-* November 2006
+* December 2016
*
* .. Scalar Arguments ..
INTEGER GIVPTR, ICOMPQ, INFO, K, LDGCOL, LDGNUM, NL,
@@ -21,148 +298,6 @@
$ ZW( * )
* ..
*
-* Purpose
-* =======
-*
-* DLASD7 merges the two sets of singular values together into a single
-* sorted set. Then it tries to deflate the size of the problem. There
-* are two ways in which deflation can occur: when two or more singular
-* values are close together or if there is a tiny entry in the Z
-* vector. For each such occurrence the order of the related
-* secular equation problem is reduced by one.
-*
-* DLASD7 is called from DLASD6.
-*
-* Arguments
-* =========
-*
-* ICOMPQ (input) INTEGER
-* Specifies whether singular vectors are to be computed
-* in compact form, as follows:
-* = 0: Compute singular values only.
-* = 1: Compute singular vectors of upper
-* bidiagonal matrix in compact form.
-*
-* NL (input) INTEGER
-* The row dimension of the upper block. NL >= 1.
-*
-* NR (input) INTEGER
-* The row dimension of the lower block. NR >= 1.
-*
-* SQRE (input) INTEGER
-* = 0: the lower block is an NR-by-NR square matrix.
-* = 1: the lower block is an NR-by-(NR+1) rectangular matrix.
-*
-* The bidiagonal matrix has
-* N = NL + NR + 1 rows and
-* M = N + SQRE >= N columns.
-*
-* K (output) INTEGER
-* Contains the dimension of the non-deflated matrix, this is
-* the order of the related secular equation. 1 <= K <=N.
-*
-* D (input/output) DOUBLE PRECISION array, dimension ( N )
-* On entry D contains the singular values of the two submatrices
-* to be combined. On exit D contains the trailing (N-K) updated
-* singular values (those which were deflated) sorted into
-* increasing order.
-*
-* Z (output) DOUBLE PRECISION array, dimension ( M )
-* On exit Z contains the updating row vector in the secular
-* equation.
-*
-* ZW (workspace) DOUBLE PRECISION array, dimension ( M )
-* Workspace for Z.
-*
-* VF (input/output) DOUBLE PRECISION array, dimension ( M )
-* On entry, VF(1:NL+1) contains the first components of all
-* right singular vectors of the upper block; and VF(NL+2:M)
-* contains the first components of all right singular vectors
-* of the lower block. On exit, VF contains the first components
-* of all right singular vectors of the bidiagonal matrix.
-*
-* VFW (workspace) DOUBLE PRECISION array, dimension ( M )
-* Workspace for VF.
-*
-* VL (input/output) DOUBLE PRECISION array, dimension ( M )
-* On entry, VL(1:NL+1) contains the last components of all
-* right singular vectors of the upper block; and VL(NL+2:M)
-* contains the last components of all right singular vectors
-* of the lower block. On exit, VL contains the last components
-* of all right singular vectors of the bidiagonal matrix.
-*
-* VLW (workspace) DOUBLE PRECISION array, dimension ( M )
-* Workspace for VL.
-*
-* ALPHA (input) DOUBLE PRECISION
-* Contains the diagonal element associated with the added row.
-*
-* BETA (input) DOUBLE PRECISION
-* Contains the off-diagonal element associated with the added
-* row.
-*
-* DSIGMA (output) DOUBLE PRECISION array, dimension ( N )
-* Contains a copy of the diagonal elements (K-1 singular values
-* and one zero) in the secular equation.
-*
-* IDX (workspace) INTEGER array, dimension ( N )
-* This will contain the permutation used to sort the contents of
-* D into ascending order.
-*
-* IDXP (workspace) INTEGER array, dimension ( N )
-* This will contain the permutation used to place deflated
-* values of D at the end of the array. On output IDXP(2:K)
-* points to the nondeflated D-values and IDXP(K+1:N)
-* points to the deflated singular values.
-*
-* IDXQ (input) INTEGER array, dimension ( N )
-* This contains the permutation which separately sorts the two
-* sub-problems in D into ascending order. Note that entries in
-* the first half of this permutation must first be moved one
-* position backward; and entries in the second half
-* must first have NL+1 added to their values.
-*
-* PERM (output) INTEGER array, dimension ( N )
-* The permutations (from deflation and sorting) to be applied
-* to each singular block. Not referenced if ICOMPQ = 0.
-*
-* GIVPTR (output) INTEGER
-* The number of Givens rotations which took place in this
-* subproblem. Not referenced if ICOMPQ = 0.
-*
-* GIVCOL (output) INTEGER array, dimension ( LDGCOL, 2 )
-* Each pair of numbers indicates a pair of columns to take place
-* in a Givens rotation. Not referenced if ICOMPQ = 0.
-*
-* LDGCOL (input) INTEGER
-* The leading dimension of GIVCOL, must be at least N.
-*
-* GIVNUM (output) DOUBLE PRECISION array, dimension ( LDGNUM, 2 )
-* Each number indicates the C or S value to be used in the
-* corresponding Givens rotation. Not referenced if ICOMPQ = 0.
-*
-* LDGNUM (input) INTEGER
-* The leading dimension of GIVNUM, must be at least N.
-*
-* C (output) DOUBLE PRECISION
-* C contains garbage if SQRE =0 and the C-value of a Givens
-* rotation related to the right null space if SQRE = 1.
-*
-* S (output) DOUBLE PRECISION
-* S contains garbage if SQRE =0 and the S-value of a Givens
-* rotation related to the right null space if SQRE = 1.
-*
-* INFO (output) INTEGER
-* = 0: successful exit.
-* < 0: if INFO = -i, the i-th argument had an illegal value.
-*
-* Further Details
-* ===============
-*
-* Based on contributions by
-* Ming Gu and Huan Ren, Computer Science Division, University of
-* California at Berkeley, USA
-*
* =====================================================================
*
* .. Parameters ..