1DLASD2(1)           LAPACK auxiliary routine (version 3.2)           DLASD2(1)
2
3
4

NAME

6       DLASD2  - merges the two sets of singular values together into a single
7       sorted set
8

SYNOPSIS

10       SUBROUTINE DLASD2( NL, NR, SQRE, K, D, Z,  ALPHA,  BETA,  U,  LDU,  VT,
11                          LDVT, DSIGMA, U2, LDU2, VT2, LDVT2, IDXP, IDX, IDXC,
12                          IDXQ, COLTYP, INFO )
13
14           INTEGER        INFO, K, LDU, LDU2, LDVT, LDVT2, NL, NR, SQRE
15
16           DOUBLE         PRECISION ALPHA, BETA
17
18           INTEGER        COLTYP( * ), IDX( * ), IDXC( * ), IDXP( * ), IDXQ( *
19                          )
20
21           DOUBLE         PRECISION  D(  *  ),  DSIGMA(  * ), U( LDU, * ), U2(
22                          LDU2, * ), VT( LDVT, * ), VT2( LDVT2, * ), Z( * )
23

PURPOSE

25       DLASD2 merges the two sets of singular values together  into  a  single
26       sorted  set.   Then it tries to deflate the size of the problem.  There
27       are two ways in which deflation can occur:  when two or  more  singular
28       values  are close together or if there is a tiny entry in the Z vector.
29       For each such occurrence the order  of  the  related  secular  equation
30       problem is reduced by one.
31       DLASD2 is called from DLASD1.
32

ARGUMENTS

34       NL     (input) INTEGER
35              The row dimension of the upper block.  NL >= 1.
36
37       NR     (input) INTEGER
38              The row dimension of the lower block.  NR >= 1.
39
40       SQRE   (input) INTEGER
41              = 0: the lower block is an NR-by-NR square matrix.
42              = 1: the lower block is an NR-by-(NR+1) rectangular matrix.  The
43              bidiagonal matrix has N = NL + NR + 1 rows and M = N + SQRE >= N
44              columns.
45
46       K      (output) INTEGER
47              Contains  the  dimension of the non-deflated matrix, This is the
48              order of the related secular equation. 1 <= K <=N.
49
50       D      (input/output) DOUBLE PRECISION array, dimension(N)
51              On entry D contains the singular values of the  two  submatrices
52              to  be  combined.  On exit D contains the trailing (N-K) updated
53              singular values (those which were deflated) sorted into increas‐
54              ing order.
55
56       Z      (output) DOUBLE PRECISION array, dimension(N)
57              On  exit Z contains the updating row vector in the secular equa‐
58              tion.
59
60       ALPHA  (input) DOUBLE PRECISION
61              Contains the diagonal element associated with the added row.
62
63       BETA   (input) DOUBLE PRECISION
64              Contains the off-diagonal element associated with the added row.
65
66       U      (input/output) DOUBLE PRECISION array, dimension(LDU,N)
67              On entry U contains the left singular vectors of two submatrices
68              in  the  two  square blocks with corners at (1,1), (NL, NL), and
69              (NL+2, NL+2), (N,N).  On exit  U  contains  the  trailing  (N-K)
70              updated left singular vectors (those which were deflated) in its
71              last N-K columns.
72
73       LDU    (input) INTEGER
74              The leading dimension of the array U.  LDU >= N.
75
76       VT     (input/output) DOUBLE PRECISION array, dimension(LDVT,M)
77              On entry VT' contains the right singular vectors of  two  subma‐
78              trices  in  the  two square blocks with corners at (1,1), (NL+1,
79              NL+1), and (NL+2, NL+2), (M,M).  On exit VT' contains the trail‐
80              ing  (N-K)  updated  right  singular  vectors  (those which were
81              deflated) in its last N-K columns.  In case SQRE  =1,  the  last
82              row of VT spans the right null space.
83
84       LDVT   (input) INTEGER
85              The leading dimension of the array VT.  LDVT >= M.  DSIGMA (out‐
86              put) DOUBLE PRECISION array, dimension (N) Contains  a  copy  of
87              the  diagonal elements (K-1 singular values and one zero) in the
88              secular equation.
89
90       U2     (output) DOUBLE PRECISION array, dimension(LDU2,N)
91              Contains a copy of the first K-1  left  singular  vectors  which
92              will be used by DLASD3 in a matrix multiply (DGEMM) to solve for
93              the new left singular vectors. U2 is arranged into four  blocks.
94              The first block contains a column with 1 at NL+1 and zero every‐
95              where else; the second block contains non-zero entries  only  at
96              and  above  NL;  the  third contains non-zero entries only below
97              NL+1; and the fourth is dense.
98
99       LDU2   (input) INTEGER
100              The leading dimension of the array U2.  LDU2 >= N.
101
102       VT2    (output) DOUBLE PRECISION array, dimension(LDVT2,N)
103              VT2' contains a copy of the first K right singular vectors which
104              will be used by DLASD3 in a matrix multiply (DGEMM) to solve for
105              the new right singular  vectors.  VT2  is  arranged  into  three
106              blocks.  The  first block contains a row that corresponds to the
107              special 0 diagonal element in SIGMA; the second  block  contains
108              non-zeros  only  at  and  before NL +1; the third block contains
109              non-zeros only at and after  NL +2.
110
111       LDVT2  (input) INTEGER
112              The leading dimension of the array VT2.  LDVT2 >= M.
113
114       IDXP   (workspace) INTEGER array dimension(N)
115              This will contain the permutation used to place deflated  values
116              of D at the end of the array. On output IDXP(2:K)
117              points to the nondeflated D-values and IDXP(K+1:N) points to the
118              deflated singular values.
119
120       IDX    (workspace) INTEGER array dimension(N)
121              This will contain the permutation used to sort the contents of D
122              into ascending order.
123
124       IDXC   (output) INTEGER array dimension(N)
125              This will contain the permutation used to arrange the columns of
126              the deflated U matrix into three groups:  the first  group  con‐
127              tains non-zero entries only at and above NL, the second contains
128              non-zero entries only below NL+2, and the third is dense.
129
130       IDXQ   (input/output) INTEGER array dimension(N)
131              This contains the permutation which  separately  sorts  the  two
132              sub-problems  in  D  into ascending order.  Note that entries in
133              the first hlaf of this permutation must first be moved one posi‐
134              tion  backward;  and  entries in the second half must first have
135              NL+1 added to their values.  COLTYP  (workspace/output)  INTEGER
136              array dimension(N) As workspace, this will contain a label which
137              will indicate which of the following types a column  in  the  U2
138              matrix or a row in the VT2 matrix is:
139              1 : non-zero in the upper half only
140              2 : non-zero in the lower half only
141              3 : dense
142              4  :  deflated  On  exit,  it  is  an array of dimension 4, with
143              COLTYP(I) being the dimension of the I-th type columns.
144
145       INFO   (output) INTEGER
146              = 0:  successful exit.
147              < 0:  if INFO = -i, the i-th argument had an illegal value.
148

FURTHER DETAILS

150       Based on contributions by
151          Ming Gu and Huan Ren, Computer Science Division, University of
152          California at Berkeley, USA
153
154
155
156 LAPACK auxiliary routine (versionNo3v.e2m)ber 2008                       DLASD2(1)
Impressum