Used by sstedc/dstedc. Merges eigenvalues and deflates secular equation. Used when the original matrix is tridiagonal.


call slaed2( k, n, n1, d, q, ldq, indxq, rho, z, dlamda, w, q2, indx, indxc, indxp, coltyp, info )

call dlaed2( k, n, n1, d, q, ldq, indxq, rho, z, dlamda, w, q2, indx, indxc, indxp, coltyp, info )

Include Files

  • mkl.fi


The routine ?laed2 merges the two sets of eigenvalues 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 eigenvalues 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.

Input Parameters


INTEGER. The number of non-deflated eigenvalues, and the order of the related secular equation (0 ≤ kn).


INTEGER. The dimension of the symmetric tridiagonal matrix (n 0).


INTEGER. The location of the last eigenvalue in the leading sub-matrix; min(1,n) ≤ n1n/2.

d, q, z

REAL for slaed2



d(*) contains the eigenvalues of the two submatrices to be combined. The dimension of d must be at least max(1, n).

q(ldq, *) contains the eigenvectors of the two submatrices in the two square blocks with corners at (1,1), (n1,n1) and (n1+1,n1+1), (n,n). The second dimension of q must be at least max(1, n).

z(*) contains the updating vector (the last row of the first sub-eigenvector matrix and the first row of the second sub-eigenvector matrix).


INTEGER. The leading dimension of the array q; ldq max(1, n).


INTEGER. Array, dimension (n).

On entry, the permutation which separately sorts the two subproblems in d into ascending order. Note that elements in the second half of this permutation must first have n1 added to their values.


REAL for slaed2


On entry, the off-diagonal element associated with the rank-1 cut which originally split the two submatrices which are now being recombined.

indx, indxp


Workspace arrays, dimension (n) each. Array indx contains the permutation used to sort the contents of dlamda into ascending order.

Array indxp contains the permutation used to place deflated values of d at the end of the array.

indxp(1:k) points to the nondeflated d-values and indxp(k+1:n) points to the deflated eigenvalues.



Workspace array, dimension (n).

During execution, a label which will indicate which of the following types a column in the q2 matrix is:

1 : non-zero in the upper half only;

2 : dense;

3 : non-zero in the lower half only;

4 : deflated.

Output Parameters


On exit, d contains the trailing (n-k) updated eigenvalues (those which were deflated) sorted into increasing order.


On exit, q contains the trailing (n-k) updated eigenvectors (those which were deflated) in its last n-k columns.


On exit, z content is destroyed by the updating process.


Destroyed on exit.


On exit, rho has been modified to the value required by ?laed3.

dlamda, w, q2

REAL for slaed2


Arrays: dlamda(n), w(n), q2(n12+(n-n1)2).

The array dlamda contains a copy of the first k eigenvalues which is used by ?laed3 to form the secular equation.

The array w contains the first k values of the final deflation-altered z-vector which is passed to ?laed3.

The array q2 contains a copy of the first k eigenvectors which is used by ?laed3 in a matrix multiply (sgemm/dgemm) to solve for the new eigenvectors.


INTEGER. Array, dimension (n).

The permutation used to arrange the columns of the deflated q matrix into three groups: the first group contains non-zero elements only at and above n1, the second contains non-zero elements only below n1, and the third is dense.


On exit, coltyp(i) is the number of columns of type i, for i=1 to 4 only (see the definition of types in the description of coltyp in Input Parameters).



If info = 0, the execution is successful.

If info = -i, the i-th parameter had an illegal value.

For more complete information about compiler optimizations, see our Optimization Notice.