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

◆ dorml2()

subroutine dorml2 ( 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 )

DORML2 multiplies a general matrix by the orthogonal matrix from a LQ factorization determined by sgelqf (unblocked algorithm).

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

Purpose:
!>
!> DORML2 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 DGELQF. 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,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
!>          DGELQF in the first k rows of its array argument A.
!> 
[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 DGELQF.
!> 
[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 dorml2.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, IC, JC, MI, NI, NQ
178* ..
179* .. External Functions ..
180 LOGICAL LSAME
181 EXTERNAL lsame
182* ..
183* .. External Subroutines ..
184 EXTERNAL dlarf1f, 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, k ) ) 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( 'DORML2', -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 jc = 1
243 ELSE
244 mi = m
245 ic = 1
246 END IF
247*
248 DO 10 i = i1, i2, i3
249 IF( left ) THEN
250*
251* H(i) is applied to C(i:m,1:n)
252*
253 mi = m - i + 1
254 ic = i
255 ELSE
256*
257* H(i) is applied to C(1:m,i:n)
258*
259 ni = n - i + 1
260 jc = i
261 END IF
262*
263* Apply H(i)
264*
265 CALL dlarf1f( side, mi, ni, a( i, i ), lda, tau( i ),
266 $ c( ic, jc ), ldc, work )
267 10 CONTINUE
268 RETURN
269*
270* End of DORML2
271*
subroutine xerbla(srname, info)
Definition cblat2.f:3285
subroutine dlarf1f(side, m, n, v, incv, tau, c, ldc, work)
DLARF1F applies an elementary reflector to a general rectangular
Definition dlarf1f.f:157
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: