Solves a general Gauss-Markov linear model problem using a generalized QR factorization.
FORTRAN 77:
call sggglm(n, m, p, a, lda, b, ldb, d, x, y, work, lwork, info)
call dggglm(n, m, p, a, lda, b, ldb, d, x, y, work, lwork, info)
call cggglm(n, m, p, a, lda, b, ldb, d, x, y, work, lwork, info)
call zggglm(n, m, p, a, lda, b, ldb, d, x, y, work, lwork, info)
Fortran 95:
call ggglm(a, b, d, x, y [,info])
C:
lapack_int LAPACKE_<?>ggglm( int matrix_order, lapack_int n, lapack_int m, lapack_int p, <datatype>* a, lapack_int lda, <datatype>* b, lapack_int ldb, <datatype>* d, <datatype>* x, <datatype>* y );
The FORTRAN 77 interfaces are specified in the mkl_lapack.fi and mkl_lapack.h include files, the Fortran 95 interfaces are specified in the lapack.f90 include file, and the C interfaces are specified in the mkl_lapacke.h include file.
The routine solves a general Gauss-Markov linear model (GLM) problem:
minimizex ||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(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 (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
minimizex ||B-1(d-A*x)||2.
The data types are given for the Fortran interface. A <datatype> placeholder, if present, is used for the C interface data types in the C interface section above. See C Interface Conventions for the C interface principal conventions and type definitions.
INTEGER. The number of rows of the matrices A and B (n ≥ 0).
INTEGER. The number of columns in A (m ≥ 0).
INTEGER. The number of columns in B (p ≥ n - m).
REAL for sggglm
DOUBLE PRECISION for dggglm
COMPLEX for cggglm
DOUBLE COMPLEX for zggglm.
Arrays:
a(lda,*) contains the n-by-m matrix A.
The second dimension of a must be at least max(1, m).
b(ldb,*) contains the n-by-p matrix B.
The second dimension of b must be at least max(1, p).
d(*), dimension at least max(1, n), contains the left hand side of the GLM equation.
work is a workspace array, its dimension max(1, lwork).
INTEGER. The leading dimension of a; at least max(1, n).
INTEGER. The leading dimension of b; at least max(1, n).
INTEGER. 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.
REAL for sggglm
DOUBLE PRECISION for dggglm
COMPLEX for cggglm
DOUBLE COMPLEX for zggglm.
Arrays x(*), y(*). DIMENSION 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.
On exit, the upper triangular part of the array a contains the m-by-m upper triangular matrix R.
On exit, if n ≤ p, the upper triangle of the subarray b(1:n,p-n+1:p) contains the n-by-n upper triangular matrix T; if n > p, the elements on and above the (n-p)-th subdiagonal contain the n-by-p upper trapezoidal matrix T.
On exit, d is destroyed
If info = 0, on exit, work(1) contains the minimum value of lwork required for optimum performance.
INTEGER.
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(A B) < n; the least squares solution could not be computed.
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77 counterparts. For general conventions applied to skip redundant or restorable arguments, see Fortran 95 Interface Conventions.
Specific details for the routine ggglm interface are the following:
Holds the matrix A of size (n,m).
Holds the matrix B of size (n,p).
Holds the vector of length n.
Holds the vector of length (m).
Holds the vector of length (p).
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.
Copyright © 1994 - 2011, Intel Corporation. All rights reserved.