Developer Reference for Intel® oneAPI Math Kernel Library for C
?ggglm
Solves a general Gauss-Markov linear model problem using a generalized QR factorization.
Syntax
lapack_intLAPACKE_sggglm ( intmatrix_layout , lapack_intn , lapack_intm , lapack_intp , float*a , lapack_intlda , float*b , lapack_intldb , float*d , float*x , float*y );
lapack_intLAPACKE_dggglm ( intmatrix_layout , lapack_intn , lapack_intm , lapack_intp , double*a , lapack_intlda , double*b , lapack_intldb , double*d , double*x , double*y );
lapack_intLAPACKE_cggglm ( intmatrix_layout , lapack_intn , lapack_intm , lapack_intp , lapack_complex_float*a , lapack_intlda , lapack_complex_float*b , lapack_intldb , lapack_complex_float*d , lapack_complex_float*x , lapack_complex_float*y );
lapack_intLAPACKE_zggglm ( intmatrix_layout , lapack_intn , lapack_intm , lapack_intp , lapack_complex_double*a , lapack_intlda , lapack_complex_double*b , lapack_intldb , lapack_complex_double*d , lapack_complex_double*x , lapack_complex_double*y );
Include Files
mkl.h
Description
sggglm dggglm cggglm zggglm ggglm
The routine solves a general Gauss-Markov linear model (GLM) problem:
minimize_{x} ||y||_{2} subject to d = A*x + B*y
where 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 , and rank(A) = m and rank(AB) = 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 (A, B ) given by
In particular, if matrix B is square nonsingular, then the problem GLM is equivalent to the following weighted linear least squares problem
minimize_{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 matrices A and B ( n≥ 0 ).
m
The number of columns in A ( m≥ 0 ).
p
The number of columns in B ( p≥n - m ).
- a , b , d , work
-
REAL for sggglm DOUBLE PRECISION for dggglm COMPLEX for cggglm DOUBLE COMPLEX for zggglm . Arrays:
a (size max(1, lda * m ) for column major layout and max(1, lda * n ) for row major layout) contains the n -by- m matrix A .
The second dimension of a must be at least max(1, m ).
b (size max(1, ldb * p ) for column major layout and max(1, ldb * n ) for row major layout) contains the n -by- p matrix B .
The second dimension of b must be at least max(1, p ).
d , size at least max(1, n ), contains the left hand side of the GLM equation.
work is a workspace array, its dimension max(1, lwork) .
lda
The leading dimension of a ; at least max(1, n ) for column major layout and max(1, m ) for row major layout .
ldb
The leading dimension of b ; at least max(1, n ) for column major layout and max(1, p ) for row major layout .
lwork
The size of the work array; lwork≥ max(1, n+m+p) .
If lwork = -1 , then a workspace query is assumed; the routine only calculates the optimal size of the work array, returns this value as the first entry of the work array, and no error message related to lwork is issued by xerbla . See Application Notes for the suggested value of lwork .
Output Parameters
- x , y
-
REAL for sggglm DOUBLE PRECISION for dggglm COMPLEX for cggglm DOUBLE COMPLEX for zggglm .
Arrays x , y . size at least max(1, m ) for x and at least max(1, p ) for y .
On exit, x and y are the solutions of the GLM problem.
- a
-
On exit, the upper triangular part of the array a contains the m -by- m upper triangular matrix R .
b
On exit, if n ≤ p , the upper right triangle contains the n -by- n upper triangular matrix T as returned by ?ggrqf ; if n > p , the elements on and above the (n-p) -th subdiagonal contain the n -by- p upper trapezoidal matrix T .
- d
-
On exit, d is destroyed
- work(1)
-
If info = 0 , on exit, work(1) contains the minimum value of lwork required for optimum performance.
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 = 1 , the upper triangular factor R associated with A in the generalized QR factorization of the pair (A, B) is singular, so that rank(A) < m ; the least squares solution could not be computed.
If info = 2 , the bottom (n-m) -by- (n-m) part of the upper trapezoidal factor T associated with B in the generalized QR factorization of the pair (A, B) is singular, so that rank(AB) < n ; the least squares solution could not be computed.
LAPACK 95 Interface Notes
There exist FORTRAN 77 and FORTRAN 95 interfaces for this routine. See the Intel® oneMKL Fortran Developer Reference for details.
Application Notes
For optimum performance, use
lwork≥m + min(n, p) + max(n, p)*nb ,
where nb is an upper bound for the optimal blocksizes for ?geqrf , ?gerqf , ?ormqr / ?unmqr and ?ormrq / ?unmrq .
You may set lwork to -1. The routine returns immediately and provides the recommended workspace in the first element of the corresponding array ( work ). This operation is called a workspace query.
Note that if you set lwork to less than the minimal required value and not -1, the routine returns immediately with an error exit and does not provide any information on the recommended workspace.