Developer Reference for Intel® oneAPI Math Kernel Library for C

ID 766684
Date 3/22/2024
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

?lasd2

Merges the two sets of singular values together into a single sorted set. Used by ?bdsdc.

Syntax

void slasd2( lapack_int *nl, lapack_int *nr, lapack_int *sqre, lapack_int *k, float *d, float *z, float *alpha, float *beta, float *u, lapack_int *ldu, float *vt, lapack_int *ldvt, float *dsigma, float *u2, lapack_int *ldu2, float *vt2, lapack_int *ldvt2, lapack_int *idxp, lapack_int *idx, lapack_int *idxq, lapack_int *coltyp, lapack_int *info );

void dlasd2( lapack_int *nl, lapack_int *nr, lapack_int *sqre, lapack_int *k, double *d, double *z, double *alpha, double *beta, double *u, lapack_int *ldu, double *vt, lapack_int *ldvt, double *dsigma, double *u2, lapack_int *ldu2, double *vt2, lapack_int *ldvt2, lapack_int *idxp, lapack_int *idx, lapack_int *idxq, lapack_int *coltyp, lapack_int *info );

Include Files

  • mkl.h

Description

The routine ?lasd2 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.

The routine ?lasd2 is called from ?lasd1.

Input Parameters

nl

The row dimension of the upper block.

nl 1.

nr

The row dimension of the lower block.

nr 1.

sqre

If sqre = 0): the lower block is an nr-by-nr square matrix

If sqre = 1): the lower block is an nr-by-(nr+1) rectangular matrix. The bidiagonal matrix has n = nl + nr + 1 rows and m = n + sqren columns.

d

Array, DIMENSION (n). On entry d contains the singular values of the two submatrices to be combined.

alpha

Contains the diagonal element associated with the added row.

beta

Contains the off-diagonal element associated with the added row.

u

Array, DIMENSION (ldu, n). On entry u contains the left singular vectors of two submatrices in the two square blocks with corners at (1,1), (nl, nl), and (nl+2, nl+2), (n,n).

ldu

The leading dimension of the array u.

ldun.

ldu2

The leading dimension of the output array u2. ldu2n.

vt

Array, DIMENSION (ldvt, m). On entry, vtT contains the right singular vectors of two submatrices in the two square blocks with corners at (1,1), (nl+1, nl+1), and (nl+2, nl+2), (m, m).

ldvt

The leading dimension of the array vt. ldvtm.

ldvt2

The leading dimension of the output array vt2. ldvt2m.

idxp

Workspace 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.

idx

Workspace array, DIMENSION (n). This will contain the permutation used to sort the contents of d into ascending order.

coltyp

Workspace array, DIMENSION (n). As workspace, this array contains a label that indicates which of the following types a column in the u2 matrix or a row in the vt2 matrix is:

1 : non-zero in the upper half only

2 : non-zero in the lower half only

3 : dense

4 : deflated.

idxq

Array, DIMENSION (n). This parameter contains the permutation that separately sorts the two sub-problems in D in the ascending order. Note that entries in the first half of this permutation must first be moved one position backwards and entries in the second half must have nl+1 added to their values.

Output Parameters

k

Contains the dimension of the non-deflated matrix, This is the order of the related secular equation. 1 ≤ kn.

d

On exit D contains the trailing (n-k) updated singular values (those which were deflated) sorted into increasing order.

u

On exit u contains the trailing (n-k) updated left singular vectors (those which were deflated) in its last n-k columns.

z

Array, DIMENSION (n). On exit, z contains the updating row vector in the secular equation.

dsigma

Array, DIMENSION (n). Contains a copy of the diagonal elements (k-1 singular values and one zero) in the secular equation.

u2

Array, DIMENSION (ldu2, n). Contains a copy of the first k-1 left singular vectors which will be used by ?lasd3 in a matrix multiply (?gemm) to solve for the new left singular vectors. u2 is arranged into four blocks. The first block contains a column with 1 at nl+1 and zero everywhere else; the second block contains non-zero entries only at and above nl; the third contains non-zero entries only below nl+1; and the fourth is dense.

vt

On exit, vtT contains the trailing (n-k) updated right singular vectors (those which were deflated) in its last n-k columns. In case sqre =1, the last row of vt spans the right null space.

vt2

Array, DIMENSION (ldvt2, n). vt2T contains a copy of the first k right singular vectors which will be used by ?lasd3 in a matrix multiply (?gemm) to solve for the new right singular vectors. vt2 is arranged into three blocks. The first block contains a row that corresponds to the special 0 diagonal element in sigma; the second block contains non-zeros only at and before nl +1; the third block contains non-zeros only at and after nl +2.

idxc

Array, DIMENSION (n). This will contain the permutation used to arrange the columns of the deflated u matrix into three groups: the first group contains non-zero entries only at and above nl, the second contains non-zero entries only below nl+2, and the third is dense.

coltyp

On exit, it is an array of dimension 4, with coltyp(i) being the dimension of the i-th type columns.

info

If info = 0): successful exit

If info = -i < 0, the i-th argument had an illegal value.