LAPACK 3.12.1
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches
dorml2.f
Go to the documentation of this file.
1*> \brief \b DORML2 multiplies a general matrix by the orthogonal matrix from a LQ factorization determined by sgelqf (unblocked algorithm).
2*
3* =========== DOCUMENTATION ===========
4*
5* Online html documentation available at
6* http://www.netlib.org/lapack/explore-html/
7*
8*> Download DORML2 + dependencies
9*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/dorml2.f">
10*> [TGZ]</a>
11*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/dorml2.f">
12*> [ZIP]</a>
13*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dorml2.f">
14*> [TXT]</a>
15*
16* Definition:
17* ===========
18*
19* SUBROUTINE DORML2( SIDE, TRANS, M, N, K, A, LDA, TAU, C, LDC,
20* WORK, INFO )
21*
22* .. Scalar Arguments ..
23* CHARACTER SIDE, TRANS
24* INTEGER INFO, K, LDA, LDC, M, N
25* ..
26* .. Array Arguments ..
27* DOUBLE PRECISION A( LDA, * ), C( LDC, * ), TAU( * ), WORK( * )
28* ..
29*
30*
31*> \par Purpose:
32* =============
33*>
34*> \verbatim
35*>
36*> DORML2 overwrites the general real m by n matrix C with
37*>
38*> Q * C if SIDE = 'L' and TRANS = 'N', or
39*>
40*> Q**T* C if SIDE = 'L' and TRANS = 'T', or
41*>
42*> C * Q if SIDE = 'R' and TRANS = 'N', or
43*>
44*> C * Q**T if SIDE = 'R' and TRANS = 'T',
45*>
46*> where Q is a real orthogonal matrix defined as the product of k
47*> elementary reflectors
48*>
49*> Q = H(k) . . . H(2) H(1)
50*>
51*> as returned by DGELQF. Q is of order m if SIDE = 'L' and of order n
52*> if SIDE = 'R'.
53*> \endverbatim
54*
55* Arguments:
56* ==========
57*
58*> \param[in] SIDE
59*> \verbatim
60*> SIDE is CHARACTER*1
61*> = 'L': apply Q or Q**T from the Left
62*> = 'R': apply Q or Q**T from the Right
63*> \endverbatim
64*>
65*> \param[in] TRANS
66*> \verbatim
67*> TRANS is CHARACTER*1
68*> = 'N': apply Q (No transpose)
69*> = 'T': apply Q**T (Transpose)
70*> \endverbatim
71*>
72*> \param[in] M
73*> \verbatim
74*> M is INTEGER
75*> The number of rows of the matrix C. M >= 0.
76*> \endverbatim
77*>
78*> \param[in] N
79*> \verbatim
80*> N is INTEGER
81*> The number of columns of the matrix C. N >= 0.
82*> \endverbatim
83*>
84*> \param[in] K
85*> \verbatim
86*> K is INTEGER
87*> The number of elementary reflectors whose product defines
88*> the matrix Q.
89*> If SIDE = 'L', M >= K >= 0;
90*> if SIDE = 'R', N >= K >= 0.
91*> \endverbatim
92*>
93*> \param[in] A
94*> \verbatim
95*> A is DOUBLE PRECISION array, dimension
96*> (LDA,M) if SIDE = 'L',
97*> (LDA,N) if SIDE = 'R'
98*> The i-th row must contain the vector which defines the
99*> elementary reflector H(i), for i = 1,2,...,k, as returned by
100*> DGELQF in the first k rows of its array argument A.
101*> \endverbatim
102*>
103*> \param[in] LDA
104*> \verbatim
105*> LDA is INTEGER
106*> The leading dimension of the array A. LDA >= max(1,K).
107*> \endverbatim
108*>
109*> \param[in] TAU
110*> \verbatim
111*> TAU is DOUBLE PRECISION array, dimension (K)
112*> TAU(i) must contain the scalar factor of the elementary
113*> reflector H(i), as returned by DGELQF.
114*> \endverbatim
115*>
116*> \param[in,out] C
117*> \verbatim
118*> C is DOUBLE PRECISION array, dimension (LDC,N)
119*> On entry, the m by n matrix C.
120*> On exit, C is overwritten by Q*C or Q**T*C or C*Q**T or C*Q.
121*> \endverbatim
122*>
123*> \param[in] LDC
124*> \verbatim
125*> LDC is INTEGER
126*> The leading dimension of the array C. LDC >= max(1,M).
127*> \endverbatim
128*>
129*> \param[out] WORK
130*> \verbatim
131*> WORK is DOUBLE PRECISION array, dimension
132*> (N) if SIDE = 'L',
133*> (M) if SIDE = 'R'
134*> \endverbatim
135*>
136*> \param[out] INFO
137*> \verbatim
138*> INFO is INTEGER
139*> = 0: successful exit
140*> < 0: if INFO = -i, the i-th argument had an illegal value
141*> \endverbatim
142*
143* Authors:
144* ========
145*
146*> \author Univ. of Tennessee
147*> \author Univ. of California Berkeley
148*> \author Univ. of Colorado Denver
149*> \author NAG Ltd.
150*
151*> \ingroup unml2
152*
153* =====================================================================
154 SUBROUTINE dorml2( SIDE, TRANS, M, N, K, A, LDA, TAU, C, LDC,
155 $ WORK, INFO )
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*
272 END
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
subroutine dorml2(side, trans, m, n, k, a, lda, tau, c, ldc, work, info)
DORML2 multiplies a general matrix by the orthogonal matrix from a LQ factorization determined by sge...
Definition dorml2.f:156