?ggglm
?ggglm
Solves a general Gauss-Markov linear model problem using a generalized QR factorization.
Syntax
lapack_int
LAPACKE_sggglm
(
int
matrix_layout
,
lapack_int
n
,
lapack_int
m
,
lapack_int
p
,
float
*
a
,
lapack_int
lda
,
float
*
b
,
lapack_int
ldb
,
float
*
d
,
float
*
x
,
float
*
y
);
lapack_int
LAPACKE_dggglm
(
int
matrix_layout
,
lapack_int
n
,
lapack_int
m
,
lapack_int
p
,
double
*
a
,
lapack_int
lda
,
double
*
b
,
lapack_int
ldb
,
double
*
d
,
double
*
x
,
double
*
y
);
lapack_int
LAPACKE_cggglm
(
int
matrix_layout
,
lapack_int
n
,
lapack_int
m
,
lapack_int
p
,
lapack_complex_float
*
a
,
lapack_int
lda
,
lapack_complex_float
*
b
,
lapack_int
ldb
,
lapack_complex_float
*
d
,
lapack_complex_float
*
x
,
lapack_complex_float
*
y
);
lapack_int
LAPACKE_zggglm
(
int
matrix_layout
,
lapack_int
n
,
lapack_int
m
,
lapack_int
p
,
lapack_complex_double
*
a
,
lapack_int
lda
,
lapack_complex_double
*
b
,
lapack_int
ldb
,
lapack_complex_double
*
d
,
lapack_complex_double
*
x
,
lapack_complex_double
*
y
);
Include Files
- mkl.h
Description
The routine solves a general Gauss-Markov linear model (GLM) problem:
minimize ||
subject to x
y
||2
d
= A
*x
+ B
*y
where , and
A
is an n
-by-m
matrix, B
is an n
-by-p
matrix, and d
is a given n
-vector. It is assumed that m
≤
n
≤
m
+p
rank(
and A
) = m
rank(
. A
B
) = n
Under these assumptions, the constrained equation is always consistent, and there is a unique solution
x
and a minimal 2-norm solution y
, which is obtained using a generalized QR
factorization of the matrices (
given by
A
, B
)
In particular, if matrix
B
is square nonsingular, then the problem GLM is equivalent to the following weighted linear least squares problemminimize ||
.x
B
-1
(d
-A
*x
)||2
Input Parameters
- matrix_layout
- Specifies whether matrix storage layout is row major (LAPACK_ROW_MAJOR) or column major (LAPACK_COL_MAJOR).
- n
- The number of rows of the matricesAandB().n≥0
- m
- The number of columns inA().m≥0
- p
- The number of columns inB().p≥n-m
- a,b,d
- Arrays:a(size max(1,contains thelda*m) for column major layout and max(1,lda*n) for row major layout)n-by-mmatrixA.b(size max(1,contains theldb*p) for column major layout and max(1,ldb*n) for row major layout)n-by-pmatrixB.d, size at least max(1,n), contains the left hand side of the GLM equation.
- lda
- The leading dimension ofa; at least max(1,n)for column major layout and max(1,.m) for row major layout
- ldb
- The leading dimension ofb; at least max(1,n)for column major layout and max(1,.p) for row major layout
Output Parameters
- x,y
- Arraysx,y. size at least max(1,m) forxand at least max(1,p) fory.On exit,xandyare the solutions of the GLM problem.
- a
- On exit, the upper triangular part of the arrayacontains them-by-mupper triangular matrixR.
- b
- On exit, if, the upper right triangle contains then≤pn-by-nupper triangular matrixTas returned by?ggrqf; if, the elements on and above then>p(-th subdiagonal contain then-p)n-by-pupper trapezoidal matrixT.
- d
- On exit,dis destroyed
Return Values
This function returns a value
info
.If , the execution is successful.
info
=0If , the
info
= -i
i
-th parameter had an illegal value.If , the upper triangular factor
info
= 1R
associated with A
in the generalized QR factorization of the pair (
is singular, so that A
, B
)rank(
; the least squares solution could not be computed.A
) < m
If , the bottom
info
= 2(
-by-n
-m
)(
part of the upper trapezoidal factor n
-m
)T
associated with B
in the generalized QR factorization of the pair (
is singular, so that A
, B
)rank(
; the least squares solution could not be computed.A
B
) < n