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

◆ sorm2l()

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

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

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

Purpose:
!>
!> SORM2L 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 SGEQLF. 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 REAL 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
!>          SGEQLF in the last k columns 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.
!>          If SIDE = 'L', LDA >= max(1,M);
!>          if SIDE = 'R', LDA >= max(1,N).
!> 
[in]TAU
!>          TAU is REAL array, dimension (K)
!>          TAU(i) must contain the scalar factor of the elementary
!>          reflector H(i), as returned by SGEQLF.
!> 
[in,out]C
!>          C is REAL 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 REAL 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 155 of file sorm2l.f.

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