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

◆ dorm2l()

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

DORM2L multiplies a general matrix by the orthogonal matrix from a QL factorization determined by sgeqlf (unblocked algorithm).

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

Purpose:
!>
!> DORM2L 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 = 'T', or
!>
!>       C * Q  if SIDE = 'R' and TRANS = 'N', or
!>
!>       C * Q**T if SIDE = 'R' and TRANS = 'T',
!>
!> where Q is a real orthogonal matrix defined as the product of k
!> elementary reflectors
!>
!>       Q = H(k) . . . H(2) H(1)
!>
!> as returned by DGEQLF. 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]A
!>          A is DOUBLE PRECISION array, dimension (LDA,K)
!>          The i-th column must contain the vector which defines the
!>          elementary reflector H(i), for i = 1,2,...,k, as returned by
!>          DGEQLF in the last k columns of its array argument A.
!> 
[in]LDA
!>          LDA is INTEGER
!>          The leading dimension of the array A.
!>          If SIDE = 'L', LDA >= max(1,M);
!>          if SIDE = 'R', LDA >= max(1,N).
!> 
[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 DGEQLF.
!> 
[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.

Definition at line 154 of file dorm2l.f.

156*
157* -- LAPACK computational routine --
158* -- LAPACK is a software package provided by Univ. of Tennessee, --
159* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
160*
161* .. Scalar Arguments ..
162 CHARACTER SIDE, TRANS
163 INTEGER INFO, K, LDA, LDC, M, N
164* ..
165* .. Array Arguments ..
166 DOUBLE PRECISION A( LDA, * ), C( LDC, * ), TAU( * ), WORK( * )
167* ..
168*
169* =====================================================================
170*
171* .. Parameters ..
172 DOUBLE PRECISION ONE
173 parameter( one = 1.0d+0 )
174* ..
175* .. Local Scalars ..
176 LOGICAL LEFT, NOTRAN
177 INTEGER I, I1, I2, I3, MI, NI, NQ
178* ..
179* .. External Functions ..
180 LOGICAL LSAME
181 EXTERNAL lsame
182* ..
183* .. External Subroutines ..
184 EXTERNAL dlarf1l, xerbla
185* ..
186* .. Intrinsic Functions ..
187 INTRINSIC max
188* ..
189* .. Executable Statements ..
190*
191* Test the input arguments
192*
193 info = 0
194 left = lsame( side, 'L' )
195 notran = lsame( trans, 'N' )
196*
197* NQ is the order of Q
198*
199 IF( left ) THEN
200 nq = m
201 ELSE
202 nq = n
203 END IF
204 IF( .NOT.left .AND. .NOT.lsame( side, 'R' ) ) THEN
205 info = -1
206 ELSE IF( .NOT.notran .AND. .NOT.lsame( trans, 'T' ) ) THEN
207 info = -2
208 ELSE IF( m.LT.0 ) THEN
209 info = -3
210 ELSE IF( n.LT.0 ) THEN
211 info = -4
212 ELSE IF( k.LT.0 .OR. k.GT.nq ) THEN
213 info = -5
214 ELSE IF( lda.LT.max( 1, nq ) ) THEN
215 info = -7
216 ELSE IF( ldc.LT.max( 1, m ) ) THEN
217 info = -10
218 END IF
219 IF( info.NE.0 ) THEN
220 CALL xerbla( 'DORM2L', -info )
221 RETURN
222 END IF
223*
224* Quick return if possible
225*
226 IF( m.EQ.0 .OR. n.EQ.0 .OR. k.EQ.0 )
227 $ RETURN
228*
229 IF( ( left .AND. notran ) .OR. ( .NOT.left .AND. .NOT.notran ) )
230 $ THEN
231 i1 = 1
232 i2 = k
233 i3 = 1
234 ELSE
235 i1 = k
236 i2 = 1
237 i3 = -1
238 END IF
239*
240 IF( left ) THEN
241 ni = n
242 ELSE
243 mi = m
244 END IF
245*
246 DO 10 i = i1, i2, i3
247 IF( left ) THEN
248*
249* H(i) is applied to C(1:m-k+i,1:n)
250*
251 mi = m - k + i
252 ELSE
253*
254* H(i) is applied to C(1:m,1:n-k+i)
255*
256 ni = n - k + i
257 END IF
258*
259* Apply H(i)
260*
261 CALL dlarf1l( side, mi, ni, a( 1, i ), 1, tau( i ), c, ldc,
262 $ work )
263 10 CONTINUE
264 RETURN
265*
266* End of DORM2L
267*
subroutine xerbla(srname, info)
Definition cblat2.f:3285
subroutine dlarf1l(side, m, n, v, incv, tau, c, ldc, work)
DLARF1L applies an elementary reflector to a general rectangular
Definition dlarf1l.f:124
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: