LAPACK  3.6.1 LAPACK: Linear Algebra PACKage
 subroutine dgerqs ( integer M, integer N, integer NRHS, double precision, dimension( lda, * ) A, integer LDA, double precision, dimension( * ) TAU, double precision, dimension( ldb, * ) B, integer LDB, double precision, dimension( lwork ) WORK, integer LWORK, integer INFO )

DGERQS

Purpose:
``` Compute a minimum-norm solution
min || A*X - B ||
using the RQ factorization
A = R*Q
computed by DGERQF.```
Parameters
 [in] M ``` M is INTEGER The number of rows of the matrix A. M >= 0.``` [in] N ``` N is INTEGER The number of columns of the matrix A. N >= M >= 0.``` [in] NRHS ``` NRHS is INTEGER The number of columns of B. NRHS >= 0.``` [in] A ``` A is DOUBLE PRECISION array, dimension (LDA,N) Details of the RQ factorization of the original matrix A as returned by DGERQF.``` [in] LDA ``` LDA is INTEGER The leading dimension of the array A. LDA >= M.``` [in] TAU ``` TAU is DOUBLE PRECISION array, dimension (M) Details of the orthogonal matrix Q.``` [in,out] B ``` B is DOUBLE PRECISION array, dimension (LDB,NRHS) On entry, the right hand side vectors for the linear system. On exit, the solution vectors X. Each solution vector is contained in rows 1:N of a column of B.``` [in] LDB ``` LDB is INTEGER The leading dimension of the array B. LDB >= max(1,N).``` [out] WORK ` WORK is DOUBLE PRECISION array, dimension (LWORK)` [in] LWORK ``` LWORK is INTEGER The length of the array WORK. LWORK must be at least NRHS, and should be at least NRHS*NB, where NB is the block size for this environment.``` [out] INFO ``` INFO is INTEGER = 0: successful exit < 0: if INFO = -i, the i-th argument had an illegal value```
Date
November 2011

Definition at line 124 of file dgerqs.f.

124 *
125 * -- LAPACK test routine (version 3.4.0) --
126 * -- LAPACK is a software package provided by Univ. of Tennessee, --
127 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
128 * November 2011
129 *
130 * .. Scalar Arguments ..
131  INTEGER info, lda, ldb, lwork, m, n, nrhs
132 * ..
133 * .. Array Arguments ..
134  DOUBLE PRECISION a( lda, * ), b( ldb, * ), tau( * ),
135  \$ work( lwork )
136 * ..
137 *
138 * =====================================================================
139 *
140 * .. Parameters ..
141  DOUBLE PRECISION zero, one
142  parameter ( zero = 0.0d+0, one = 1.0d+0 )
143 * ..
144 * .. External Subroutines ..
145  EXTERNAL dlaset, dormrq, dtrsm, xerbla
146 * ..
147 * .. Intrinsic Functions ..
148  INTRINSIC max
149 * ..
150 * .. Executable Statements ..
151 *
152 * Test the input parameters.
153 *
154  info = 0
155  IF( m.LT.0 ) THEN
156  info = -1
157  ELSE IF( n.LT.0 .OR. m.GT.n ) THEN
158  info = -2
159  ELSE IF( nrhs.LT.0 ) THEN
160  info = -3
161  ELSE IF( lda.LT.max( 1, m ) ) THEN
162  info = -5
163  ELSE IF( ldb.LT.max( 1, n ) ) THEN
164  info = -8
165  ELSE IF( lwork.LT.1 .OR. lwork.LT.nrhs .AND. m.GT.0 .AND. n.GT.0 )
166  \$ THEN
167  info = -10
168  END IF
169  IF( info.NE.0 ) THEN
170  CALL xerbla( 'DGERQS', -info )
171  RETURN
172  END IF
173 *
174 * Quick return if possible
175 *
176  IF( n.EQ.0 .OR. nrhs.EQ.0 .OR. m.EQ.0 )
177  \$ RETURN
178 *
179 * Solve R*X = B(n-m+1:n,:)
180 *
181  CALL dtrsm( 'Left', 'Upper', 'No transpose', 'Non-unit', m, nrhs,
182  \$ one, a( 1, n-m+1 ), lda, b( n-m+1, 1 ), ldb )
183 *
184 * Set B(1:n-m,:) to zero
185 *
186  CALL dlaset( 'Full', n-m, nrhs, zero, zero, b, ldb )
187 *
188 * B := Q' * B
189 *
190  CALL dormrq( 'Left', 'Transpose', n, nrhs, m, a, lda, tau, b, ldb,
191  \$ work, lwork, info )
192 *
193  RETURN
194 *
195 * End of DGERQS
196 *
subroutine dlaset(UPLO, M, N, ALPHA, BETA, A, LDA)
DLASET initializes the off-diagonal elements and the diagonal elements of a matrix to given values...
Definition: dlaset.f:112
subroutine dtrsm(SIDE, UPLO, TRANSA, DIAG, M, N, ALPHA, A, LDA, B, LDB)
DTRSM
Definition: dtrsm.f:183
subroutine dormrq(SIDE, TRANS, M, N, K, A, LDA, TAU, C, LDC, WORK, LWORK, INFO)
DORMRQ
Definition: dormrq.f:169
subroutine xerbla(SRNAME, INFO)
XERBLA
Definition: xerbla.f:62

Here is the call graph for this function:

Here is the caller graph for this function: