Contents

# ?gelsy

Computes the minimum-norm solution to a linear least squares problem using a complete orthogonal factorization of A.

## Syntax

Include Files
• mkl.h
Description
The
?gelsy
routine computes the minimum-norm solution to a real/complex linear least squares problem:
minimize ||
b
-
A
*
x
||
2
using a complete orthogonal factorization 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 routine first computes a
QR
factorization with column pivoting:
with
R
11
defined as the largest leading submatrix whose estimated condition number is less than 1/
rcond
. The order of
R
11
,
rank
, is the effective rank of
A
. Then,
R
22
is considered to be negligible, and
R
12
is annihilated by orthogonal/unitary transformations from the right, arriving at the complete orthogonal factorization:
The minimum-norm solution is then
for real flavors and
for complex flavors,
where
Q
1
consists of the first
rank
columns of
Q
.
The
?gelsy
routine is identical to the original deprecated
?gelsx
routine except for the following differences:
• The call to the subroutine
?geqpf
has been substituted by the call to the subroutine
?geqp3
, which is a BLAS-3 version of the
QR
factorization with column pivoting.
• The matrix
B
(the right hand side) is updated with BLAS-3.
• The permutation of the matrix
B
(the right hand side) is faster and more simple.
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
.
jpvt
Array, size at least max(1,
n
).
On entry, if
jpvt
[
i
- 1]
0, the
i
-th column of
A
is permuted to the front of
AP
, otherwise the
i
-th column of
A
is a free column.
rcond
rcond
is used to determine the effective rank of
A
, which is defined as the order of the largest leading triangular submatrix
R
11
in the
QR
factorization with pivoting of
A
, whose estimated condition number < 1/
rcond
.
Output Parameters
a
On exit, overwritten by the details of the complete orthogonal factorization of
A
.
b
Overwritten by the
n
-by-
nrhs
solution matrix
X
.
jpvt
On exit, if
jpvt
[
i
- 1]
=
k
, then the
i
-th column of
AP
was the
k
-th column of
A
.
rank
The effective rank of
A
, that is, the order of the submatrix
R
11
. This is the same as the order of the submatrix
T
11
in the complete orthogonal factorization of
A
.
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.

#### 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