LAPACK 3.12.1
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches

◆ dormr3()

subroutine dormr3 ( character side,
character trans,
integer m,
integer n,
integer k,
integer l,
double precision, dimension( lda, * ) a,
integer lda,
double precision, dimension( * ) tau,
double precision, dimension( ldc, * ) c,
integer ldc,
double precision, dimension( * ) work,
integer info )

DORMR3 multiplies a general matrix by the orthogonal matrix from a RZ factorization determined by stzrzf (unblocked algorithm).

Download DORMR3 + dependencies [TGZ] [ZIP] [TXT]

Purpose:
!>
!> DORMR3 overwrites the general real m by n matrix C with
!>
!>       Q * C  if SIDE = 'L' and TRANS = 'N', or
!>
!>       Q**T* C  if SIDE = 'L' and TRANS = 'C', or
!>
!>       C * Q  if SIDE = 'R' and TRANS = 'N', or
!>
!>       C * Q**T if SIDE = 'R' and TRANS = 'C',
!>
!> where Q is a real orthogonal matrix defined as the product of k
!> elementary reflectors
!>
!>       Q = H(1) H(2) . . . H(k)
!>
!> as returned by DTZRZF. Q is of order m if SIDE = 'L' and of order n
!> if SIDE = 'R'.
!> 
Parameters
[in]SIDE
!>          SIDE is CHARACTER*1
!>          = 'L': apply Q or Q**T from the Left
!>          = 'R': apply Q or Q**T from the Right
!> 
[in]TRANS
!>          TRANS is CHARACTER*1
!>          = 'N': apply Q  (No transpose)
!>          = 'T': apply Q**T (Transpose)
!> 
[in]M
!>          M is INTEGER
!>          The number of rows of the matrix C. M >= 0.
!> 
[in]N
!>          N is INTEGER
!>          The number of columns of the matrix C. N >= 0.
!> 
[in]K
!>          K is INTEGER
!>          The number of elementary reflectors whose product defines
!>          the matrix Q.
!>          If SIDE = 'L', M >= K >= 0;
!>          if SIDE = 'R', N >= K >= 0.
!> 
[in]L
!>          L is INTEGER
!>          The number of columns of the matrix A containing
!>          the meaningful part of the Householder reflectors.
!>          If SIDE = 'L', M >= L >= 0, if SIDE = 'R', N >= L >= 0.
!> 
[in]A
!>          A is DOUBLE PRECISION array, dimension
!>                               (LDA,M) if SIDE = 'L',
!>                               (LDA,N) if SIDE = 'R'
!>          The i-th row must contain the vector which defines the
!>          elementary reflector H(i), for i = 1,2,...,k, as returned by
!>          DTZRZF in the last k rows of its array argument A.
!>          A is modified by the routine but restored on exit.
!> 
[in]LDA
!>          LDA is INTEGER
!>          The leading dimension of the array A. LDA >= max(1,K).
!> 
[in]TAU
!>          TAU is DOUBLE PRECISION array, dimension (K)
!>          TAU(i) must contain the scalar factor of the elementary
!>          reflector H(i), as returned by DTZRZF.
!> 
[in,out]C
!>          C is DOUBLE PRECISION array, dimension (LDC,N)
!>          On entry, the m-by-n matrix C.
!>          On exit, C is overwritten by Q*C or Q**T*C or C*Q**T or C*Q.
!> 
[in]LDC
!>          LDC is INTEGER
!>          The leading dimension of the array C. LDC >= max(1,M).
!> 
[out]WORK
!>          WORK is DOUBLE PRECISION array, dimension
!>                                   (N) if SIDE = 'L',
!>                                   (M) if SIDE = 'R'
!> 
[out]INFO
!>          INFO is INTEGER
!>          = 0: successful exit
!>          < 0: if INFO = -i, the i-th argument had an illegal value
!> 
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Contributors:
A. Petitet, Computer Science Dept., Univ. of Tenn., Knoxville, USA
Further Details:
!> 

Definition at line 174 of file dormr3.f.

177*
178* -- LAPACK computational routine --
179* -- LAPACK is a software package provided by Univ. of Tennessee, --
180* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
181*
182* .. Scalar Arguments ..
183 CHARACTER SIDE, TRANS
184 INTEGER INFO, K, L, LDA, LDC, M, N
185* ..
186* .. Array Arguments ..
187 DOUBLE PRECISION A( LDA, * ), C( LDC, * ), TAU( * ), WORK( * )
188* ..
189*
190* =====================================================================
191*
192* .. Local Scalars ..
193 LOGICAL LEFT, NOTRAN
194 INTEGER I, I1, I2, I3, IC, JA, JC, MI, NI, NQ
195* ..
196* .. External Functions ..
197 LOGICAL LSAME
198 EXTERNAL lsame
199* ..
200* .. External Subroutines ..
201 EXTERNAL dlarz, xerbla
202* ..
203* .. Intrinsic Functions ..
204 INTRINSIC max
205* ..
206* .. Executable Statements ..
207*
208* Test the input arguments
209*
210 info = 0
211 left = lsame( side, 'L' )
212 notran = lsame( trans, 'N' )
213*
214* NQ is the order of Q
215*
216 IF( left ) THEN
217 nq = m
218 ELSE
219 nq = n
220 END IF
221 IF( .NOT.left .AND. .NOT.lsame( side, 'R' ) ) THEN
222 info = -1
223 ELSE IF( .NOT.notran .AND. .NOT.lsame( trans, 'T' ) ) THEN
224 info = -2
225 ELSE IF( m.LT.0 ) THEN
226 info = -3
227 ELSE IF( n.LT.0 ) THEN
228 info = -4
229 ELSE IF( k.LT.0 .OR. k.GT.nq ) THEN
230 info = -5
231 ELSE IF( l.LT.0 .OR. ( left .AND. ( l.GT.m ) ) .OR.
232 $ ( .NOT.left .AND. ( l.GT.n ) ) ) THEN
233 info = -6
234 ELSE IF( lda.LT.max( 1, k ) ) THEN
235 info = -8
236 ELSE IF( ldc.LT.max( 1, m ) ) THEN
237 info = -11
238 END IF
239 IF( info.NE.0 ) THEN
240 CALL xerbla( 'DORMR3', -info )
241 RETURN
242 END IF
243*
244* Quick return if possible
245*
246 IF( m.EQ.0 .OR. n.EQ.0 .OR. k.EQ.0 )
247 $ RETURN
248*
249 IF( ( left .AND. .NOT.notran .OR. .NOT.left .AND. notran ) ) THEN
250 i1 = 1
251 i2 = k
252 i3 = 1
253 ELSE
254 i1 = k
255 i2 = 1
256 i3 = -1
257 END IF
258*
259 IF( left ) THEN
260 ni = n
261 ja = m - l + 1
262 jc = 1
263 ELSE
264 mi = m
265 ja = n - l + 1
266 ic = 1
267 END IF
268*
269 DO 10 i = i1, i2, i3
270 IF( left ) THEN
271*
272* H(i) or H(i)**T is applied to C(i:m,1:n)
273*
274 mi = m - i + 1
275 ic = i
276 ELSE
277*
278* H(i) or H(i)**T is applied to C(1:m,i:n)
279*
280 ni = n - i + 1
281 jc = i
282 END IF
283*
284* Apply H(i) or H(i)**T
285*
286 CALL dlarz( side, mi, ni, l, a( i, ja ), lda, tau( i ),
287 $ c( ic, jc ), ldc, work )
288*
289 10 CONTINUE
290*
291 RETURN
292*
293* End of DORMR3
294*
subroutine xerbla(srname, info)
Definition cblat2.f:3285
subroutine dlarz(side, m, n, l, v, incv, tau, c, ldc, work)
DLARZ applies an elementary reflector (as returned by stzrzf) to a general matrix.
Definition dlarz.f:143
logical function lsame(ca, cb)
LSAME
Definition lsame.f:48
Here is the call graph for this function:
Here is the caller graph for this function: