1
*> \brief \b CLARFX applies an elementary reflector to a general rectangular matrix, with loop unrolling when the reflector has order ≤ 10.
3
* =========== DOCUMENTATION ===========
5
* Online html documentation available at
6
* http://www.netlib.org/lapack/explore-html/
9
*> Download CLARFX + dependencies
10
*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/clarfx.f">
12
*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/clarfx.f">
14
*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/clarfx.f">
21
* SUBROUTINE CLARFX( SIDE, M, N, V, TAU, C, LDC, WORK )
23
* .. Scalar Arguments ..
28
* .. Array Arguments ..
29
* COMPLEX C( LDC, * ), V( * ), WORK( * )
38
*> CLARFX applies a complex elementary reflector H to a complex m by n
39
*> matrix C, from either the left or the right. H is represented in the
42
*> H = I - tau * v * v**H
44
*> where tau is a complex scalar and v is a complex vector.
46
*> If tau = 0, then H is taken to be the unit matrix
48
*> This version uses inline code if H has order < 11.
56
*> SIDE is CHARACTER*1
64
*> The number of rows of the matrix C.
70
*> The number of columns of the matrix C.
75
*> V is COMPLEX array, dimension (M) if SIDE = 'L'
76
*> or (N) if SIDE = 'R'
77
*> The vector v in the representation of H.
83
*> The value tau in the representation of H.
88
*> C is COMPLEX array, dimension (LDC,N)
89
*> On entry, the m by n matrix C.
90
*> On exit, C is overwritten by the matrix H * C if SIDE = 'L',
91
*> or C * H if SIDE = 'R'.
97
*> The leading dimension of the array C. LDA >= max(1,M).
102
*> WORK is COMPLEX array, dimension (N) if SIDE = 'L'
103
*> or (M) if SIDE = 'R'
104
*> WORK is not referenced if H has order < 11.
110
*> \author Univ. of Tennessee
111
*> \author Univ. of California Berkeley
112
*> \author Univ. of Colorado Denver
115
*> \date September 2012
117
*> \ingroup complexOTHERauxiliary
119
* =====================================================================
1
120
SUBROUTINE CLARFX( SIDE, M, N, V, TAU, C, LDC, WORK )
2
C$Id: clarfx.f 19697 2010-10-29 16:57:34Z d3y133 $
4
* -- LAPACK auxiliary routine (version 3.0) --
5
* Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,
6
* Courant Institute, Argonne National Lab, and Rice University
122
* -- LAPACK auxiliary routine (version 3.4.2) --
123
* -- LAPACK is a software package provided by Univ. of Tennessee, --
124
* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
9
127
* .. Scalar Arguments ..
15
133
COMPLEX C( LDC, * ), V( * ), WORK( * )
21
* CLARFX applies a complex elementary reflector H to a complex m by n
22
* matrix C, from either the left or the right. H is represented in the
25
* H = I - tau * v * v'
27
* where tau is a complex scalar and v is a complex vector.
29
* If tau = 0, then H is taken to be the unit matrix
31
* This version uses inline code if H has order < 11.
36
* SIDE (input) CHARACTER*1
41
* The number of rows of the matrix C.
44
* The number of columns of the matrix C.
46
* V (input) COMPLEX array, dimension (M) if SIDE = 'L'
47
* or (N) if SIDE = 'R'
48
* The vector v in the representation of H.
51
* The value tau in the representation of H.
53
* C (input/output) COMPLEX array, dimension (LDC,N)
54
* On entry, the m by n matrix C.
55
* On exit, C is overwritten by the matrix H * C if SIDE = 'L',
56
* or C * H if SIDE = 'R'.
59
* The leading dimension of the array C. LDA >= max(1,M).
61
* WORK (workspace) COMPLEX array, dimension (N) if SIDE = 'L'
62
* or (M) if SIDE = 'R'
63
* WORK is not referenced if H has order < 11.
65
136
* =====================================================================
67
138
* .. Parameters ..
98
169
* Code for general M
102
CALL CGEMV( 'Conjugate transpose', M, N, ONE, C, LDC, V, 1,
105
* C := C - tau * v * w'
107
CALL CGERC( M, N, -TAU, V, 1, WORK, 1, C, LDC )
171
CALL CLARF( SIDE, M, N, V, 1, TAU, C, LDC, WORK )
371
435
* Code for general N
375
CALL CGEMV( 'No transpose', M, N, ONE, C, LDC, V, 1, ZERO,
378
* C := C - tau * w * v'
380
CALL CGERC( M, N, -TAU, WORK, 1, V, 1, C, LDC )
437
CALL CLARF( SIDE, M, N, V, 1, TAU, C, LDC, WORK )