LAPACK  3.6.1
LAPACK: Linear Algebra PACKage
subroutine sormr3 ( character  SIDE,
character  TRANS,
integer  M,
integer  N,
integer  K,
integer  L,
real, dimension( lda, * )  A,
integer  LDA,
real, dimension( * )  TAU,
real, dimension( ldc, * )  C,
integer  LDC,
real, dimension( * )  WORK,
integer  INFO 
)

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

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

Purpose:
 SORMR3 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 STZRZF. 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 REAL 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
          STZRZF 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 REAL array, dimension (K)
          TAU(i) must contain the scalar factor of the elementary
          reflector H(i), as returned by STZRZF.
[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.
Date
September 2012
Contributors:
A. Petitet, Computer Science Dept., Univ. of Tenn., Knoxville, USA
Further Details:
 

Definition at line 180 of file sormr3.f.

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

Here is the call graph for this function:

Here is the caller graph for this function: