Contents

# ?gelsd

Computes the minimum-norm solution to a linear least squares problem using the singular value decomposition of A and a divide and conquer method.

## Syntax

Include Files
• mkl.h
Description
The routine computes the minimum-norm solution to a real linear least squares problem:
minimize ||
b
-
A
*
x
||
2
using the singular value decomposition (SVD) of
A
.
A
is an
m
-by-
n
matrix which may be rank-deficient.
Several right hand side vectors
b
and solution vectors
x
can be handled in a single call; they are stored as the columns of the
m
-by-
nrhs
right hand side matrix
B
and the
n
-by-
nrhs
solution matrix
X
.
The problem is solved in three steps:
1. Reduce the coefficient matrix A to bidiagonal form with Householder transformations, reducing the original problem into a "bidiagonal least squares problem" (BLS).
2. Solve the BLS using a divide and conquer approach.
3. Apply back all the Householder transformations to solve the original least squares problem.
The effective rank of
A
is determined by treating as zero those singular values which are less than
rcond
times the largest singular value.
Input Parameters
matrix_layout
Specifies whether matrix storage layout is row major (
LAPACK_ROW_MAJOR
) or column major (
LAPACK_COL_MAJOR
).
m
The number of rows of the matrix
A
(
m
0
).
n
The number of columns of the matrix
A
(
n
0
).
nrhs
The number of right-hand sides; the number of columns in
B
(
nrhs
0
).
a
,
b
Arrays:
a
(size max(1,
lda
*
n
) for column major layout and max(1,
lda
*
m
) for row major layout)
contains the
m
-by-
n
matrix
A
.
b
(size max(1,
ldb
*
nrhs
) for column major layout and max(1,
ldb
*max(
m
,
n
)) for row major layout)
contains the
m
-by-
nrhs
right hand side matrix
B
.
lda
a
; at least max(1,
m
)
for column major layout and max(1,
n
) for row major layout
.
ldb
b
; must be at least max(1,
m
,
n
)
for column major layout and at least max(1,
nrhs
) for row major layout
.
rcond
rcond
is used to determine the effective rank of
A
. Singular values
s
(
i
)
rcond
*
s
(1)
are treated as zero. If
rcond
0
, machine precision is used instead.
Output Parameters
a
On exit,
A
has been overwritten.
b
Overwritten by the
n
-by-
nrhs
solution matrix
X
.
If
m
n
and
rank
=
n
, the residual sum-of-squares for the solution in the
i
-th column is given by the sum of squares of modulus of elements
n
+1:
m
in that column.
s
Array, size at least max(1, min(
m
,
n
)). The singular values of
A
in decreasing order. The condition number of
A
in the 2-norm is
k
2
(
A
) =
s
(1)/
s
(min(
m
,
n
))
.
rank
The effective rank of
A
, that is, the number of singular values which are greater than
rcond
*
s
(1)
.
Return Values
This function returns a value
info
.
If
info
=0
, the execution is successful.
If
info
=
-i
, the
i
-th parameter had an illegal value.
If
info
=
i
, then the algorithm for computing the SVD failed to converge;
i
indicates the number of off-diagonal elements of an intermediate bidiagonal form that did not converge to zero.

#### Product and Performance Information

1

Intel's compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors. These optimizations include SSE2, SSE3, and SSSE3 instruction sets and other optimizations. Intel does not guarantee the availability, functionality, or effectiveness of any optimization on microprocessors not manufactured by Intel. Microprocessor-dependent optimizations in this product are intended for use with Intel microprocessors. Certain optimizations not specific to Intel microarchitecture are reserved for Intel microprocessors. Please refer to the applicable product User and Reference Guides for more information regarding the specific instruction sets covered by this notice.

Notice revision #20110804