zggglm.f.html
来自「famous linear algebra library (LAPACK) p」· HTML 代码 · 共 284 行 · 第 1/2 页
HTML
284 行
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>zggglm.f</title>
<meta name="generator" content="emacs 21.3.1; htmlfontify 0.20">
<style type="text/css"><!--
body { background: rgb(255, 255, 255); color: rgb(0, 0, 0); font-style: normal; font-weight: 500; font-stretch: normal; font-family: adobe-courier; font-size: 11pt; text-decoration: none; }
span.default { background: rgb(255, 255, 255); color: rgb(0, 0, 0); font-style: normal; font-weight: 500; font-stretch: normal; font-family: adobe-courier; font-size: 11pt; text-decoration: none; }
span.default a { background: rgb(255, 255, 255); color: rgb(0, 0, 0); font-style: normal; font-weight: 500; font-stretch: normal; font-family: adobe-courier; font-size: 11pt; text-decoration: underline; }
span.string { color: rgb(188, 143, 143); background: rgb(255, 255, 255); font-style: normal; font-weight: 500; font-stretch: normal; font-family: adobe-courier; font-size: 11pt; text-decoration: none; }
span.string a { color: rgb(188, 143, 143); background: rgb(255, 255, 255); font-style: normal; font-weight: 500; font-stretch: normal; font-family: adobe-courier; font-size: 11pt; text-decoration: underline; }
span.comment { color: rgb(178, 34, 34); background: rgb(255, 255, 255); font-style: normal; font-weight: 500; font-stretch: normal; font-family: adobe-courier; font-size: 11pt; text-decoration: none; }
span.comment a { color: rgb(178, 34, 34); background: rgb(255, 255, 255); font-style: normal; font-weight: 500; font-stretch: normal; font-family: adobe-courier; font-size: 11pt; text-decoration: underline; }
--></style>
</head>
<body>
<pre>
SUBROUTINE <a name="ZGGGLM.1"></a><a href="zggglm.f.html#ZGGGLM.1">ZGGGLM</a>( N, M, P, A, LDA, B, LDB, D, X, Y, WORK, LWORK,
$ INFO )
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> -- LAPACK driver routine (version 3.1) --
</span><span class="comment">*</span><span class="comment"> Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
</span><span class="comment">*</span><span class="comment"> November 2006
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> .. Scalar Arguments ..
</span> INTEGER INFO, LDA, LDB, LWORK, M, N, P
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment"> .. Array Arguments ..
</span> COMPLEX*16 A( LDA, * ), B( LDB, * ), D( * ), WORK( * ),
$ X( * ), Y( * )
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Purpose
</span><span class="comment">*</span><span class="comment"> =======
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> <a name="ZGGGLM.19"></a><a href="zggglm.f.html#ZGGGLM.1">ZGGGLM</a> solves a general Gauss-Markov linear model (GLM) problem:
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> minimize || y ||_2 subject to d = A*x + B*y
</span><span class="comment">*</span><span class="comment"> x
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> where A is an N-by-M matrix, B is an N-by-P matrix, and d is a
</span><span class="comment">*</span><span class="comment"> given N-vector. It is assumed that M <= N <= M+P, and
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> rank(A) = M and rank( A B ) = N.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Under these assumptions, the constrained equation is always
</span><span class="comment">*</span><span class="comment"> consistent, and there is a unique solution x and a minimal 2-norm
</span><span class="comment">*</span><span class="comment"> solution y, which is obtained using a generalized QR factorization
</span><span class="comment">*</span><span class="comment"> of the matrices (A, B) given by
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> A = Q*(R), B = Q*T*Z.
</span><span class="comment">*</span><span class="comment"> (0)
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> In particular, if matrix B is square nonsingular, then the problem
</span><span class="comment">*</span><span class="comment"> GLM is equivalent to the following weighted linear least squares
</span><span class="comment">*</span><span class="comment"> problem
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> minimize || inv(B)*(d-A*x) ||_2
</span><span class="comment">*</span><span class="comment"> x
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> where inv(B) denotes the inverse of B.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Arguments
</span><span class="comment">*</span><span class="comment"> =========
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> N (input) INTEGER
</span><span class="comment">*</span><span class="comment"> The number of rows of the matrices A and B. N >= 0.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> M (input) INTEGER
</span><span class="comment">*</span><span class="comment"> The number of columns of the matrix A. 0 <= M <= N.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> P (input) INTEGER
</span><span class="comment">*</span><span class="comment"> The number of columns of the matrix B. P >= N-M.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> A (input/output) COMPLEX*16 array, dimension (LDA,M)
</span><span class="comment">*</span><span class="comment"> On entry, the N-by-M matrix A.
</span><span class="comment">*</span><span class="comment"> On exit, the upper triangular part of the array A contains
</span><span class="comment">*</span><span class="comment"> the M-by-M upper triangular matrix R.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> LDA (input) INTEGER
</span><span class="comment">*</span><span class="comment"> The leading dimension of the array A. LDA >= max(1,N).
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> B (input/output) COMPLEX*16 array, dimension (LDB,P)
</span><span class="comment">*</span><span class="comment"> On entry, the N-by-P matrix B.
</span><span class="comment">*</span><span class="comment"> On exit, if N <= P, the upper triangle of the subarray
</span><span class="comment">*</span><span class="comment"> B(1:N,P-N+1:P) contains the N-by-N upper triangular matrix T;
</span><span class="comment">*</span><span class="comment"> if N > P, the elements on and above the (N-P)th subdiagonal
</span><span class="comment">*</span><span class="comment"> contain the N-by-P upper trapezoidal matrix T.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> LDB (input) INTEGER
</span><span class="comment">*</span><span class="comment"> The leading dimension of the array B. LDB >= max(1,N).
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> D (input/output) COMPLEX*16 array, dimension (N)
</span><span class="comment">*</span><span class="comment"> On entry, D is the left hand side of the GLM equation.
</span><span class="comment">*</span><span class="comment"> On exit, D is destroyed.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> X (output) COMPLEX*16 array, dimension (M)
</span><span class="comment">*</span><span class="comment"> Y (output) COMPLEX*16 array, dimension (P)
</span><span class="comment">*</span><span class="comment"> On exit, X and Y are the solutions of the GLM problem.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> WORK (workspace/output) COMPLEX*16 array, dimension (MAX(1,LWORK))
</span><span class="comment">*</span><span class="comment"> On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> LWORK (input) INTEGER
</span><span class="comment">*</span><span class="comment"> The dimension of the array WORK. LWORK >= max(1,N+M+P).
</span><span class="comment">*</span><span class="comment"> For optimum performance, LWORK >= M+min(N,P)+max(N,P)*NB,
</span><span class="comment">*</span><span class="comment"> where NB is an upper bound for the optimal blocksizes for
</span><span class="comment">*</span><span class="comment"> <a name="ZGEQRF.91"></a><a href="zgeqrf.f.html#ZGEQRF.1">ZGEQRF</a>, <a name="ZGERQF.91"></a><a href="zgerqf.f.html#ZGERQF.1">ZGERQF</a>, <a name="ZUNMQR.91"></a><a href="zunmqr.f.html#ZUNMQR.1">ZUNMQR</a> and <a name="ZUNMRQ.91"></a><a href="zunmrq.f.html#ZUNMRQ.1">ZUNMRQ</a>.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> If LWORK = -1, then a workspace query is assumed; the routine
</span><span class="comment">*</span><span class="comment"> only calculates the optimal size of the WORK array, returns
</span><span class="comment">*</span><span class="comment"> this value as the first entry of the WORK array, and no error
</span><span class="comment">*</span><span class="comment"> message related to LWORK is issued by <a name="XERBLA.96"></a><a href="xerbla.f.html#XERBLA.1">XERBLA</a>.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> INFO (output) INTEGER
</span><span class="comment">*</span><span class="comment"> = 0: successful exit.
</span><span class="comment">*</span><span class="comment"> < 0: if INFO = -i, the i-th argument had an illegal value.
</span><span class="comment">*</span><span class="comment"> = 1: the upper triangular factor R associated with A in the
</span><span class="comment">*</span><span class="comment"> generalized QR factorization of the pair (A, B) is
</span><span class="comment">*</span><span class="comment"> singular, so that rank(A) < M; the least squares
</span><span class="comment">*</span><span class="comment"> solution could not be computed.
</span><span class="comment">*</span><span class="comment"> = 2: the bottom (N-M) by (N-M) part of the upper trapezoidal
</span><span class="comment">*</span><span class="comment"> factor T associated with B in the generalized QR
</span><span class="comment">*</span><span class="comment"> factorization of the pair (A, B) is singular, so that
</span><span class="comment">*</span><span class="comment"> rank( A B ) < N; the least squares solution could not
</span><span class="comment">*</span><span class="comment"> be computed.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> ===================================================================
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> .. Parameters ..
</span> COMPLEX*16 CZERO, CONE
PARAMETER ( CZERO = ( 0.0D+0, 0.0D+0 ),
$ CONE = ( 1.0D+0, 0.0D+0 ) )
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment"> .. Local Scalars ..
</span> LOGICAL LQUERY
INTEGER I, LOPT, LWKMIN, LWKOPT, NB, NB1, NB2, NB3,
$ NB4, NP
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment"> .. External Subroutines ..
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?