Statistiques
| Révision :

root / src / lapack / double / dlarz.f @ 10

Historique | Voir | Annoter | Télécharger (4,14 ko)

1 1 pfleura2
      SUBROUTINE DLARZ( SIDE, M, N, L, V, INCV, TAU, C, LDC, WORK )
2 1 pfleura2
*
3 1 pfleura2
*  -- LAPACK routine (version 3.2) --
4 1 pfleura2
*  -- LAPACK is a software package provided by Univ. of Tennessee,    --
5 1 pfleura2
*  -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
6 1 pfleura2
*     November 2006
7 1 pfleura2
*
8 1 pfleura2
*     .. Scalar Arguments ..
9 1 pfleura2
      CHARACTER          SIDE
10 1 pfleura2
      INTEGER            INCV, L, LDC, M, N
11 1 pfleura2
      DOUBLE PRECISION   TAU
12 1 pfleura2
*     ..
13 1 pfleura2
*     .. Array Arguments ..
14 1 pfleura2
      DOUBLE PRECISION   C( LDC, * ), V( * ), WORK( * )
15 1 pfleura2
*     ..
16 1 pfleura2
*
17 1 pfleura2
*  Purpose
18 1 pfleura2
*  =======
19 1 pfleura2
*
20 1 pfleura2
*  DLARZ applies a real elementary reflector H to a real M-by-N
21 1 pfleura2
*  matrix C, from either the left or the right. H is represented in the
22 1 pfleura2
*  form
23 1 pfleura2
*
24 1 pfleura2
*        H = I - tau * v * v'
25 1 pfleura2
*
26 1 pfleura2
*  where tau is a real scalar and v is a real vector.
27 1 pfleura2
*
28 1 pfleura2
*  If tau = 0, then H is taken to be the unit matrix.
29 1 pfleura2
*
30 1 pfleura2
*
31 1 pfleura2
*  H is a product of k elementary reflectors as returned by DTZRZF.
32 1 pfleura2
*
33 1 pfleura2
*  Arguments
34 1 pfleura2
*  =========
35 1 pfleura2
*
36 1 pfleura2
*  SIDE    (input) CHARACTER*1
37 1 pfleura2
*          = 'L': form  H * C
38 1 pfleura2
*          = 'R': form  C * H
39 1 pfleura2
*
40 1 pfleura2
*  M       (input) INTEGER
41 1 pfleura2
*          The number of rows of the matrix C.
42 1 pfleura2
*
43 1 pfleura2
*  N       (input) INTEGER
44 1 pfleura2
*          The number of columns of the matrix C.
45 1 pfleura2
*
46 1 pfleura2
*  L       (input) INTEGER
47 1 pfleura2
*          The number of entries of the vector V containing
48 1 pfleura2
*          the meaningful part of the Householder vectors.
49 1 pfleura2
*          If SIDE = 'L', M >= L >= 0, if SIDE = 'R', N >= L >= 0.
50 1 pfleura2
*
51 1 pfleura2
*  V       (input) DOUBLE PRECISION array, dimension (1+(L-1)*abs(INCV))
52 1 pfleura2
*          The vector v in the representation of H as returned by
53 1 pfleura2
*          DTZRZF. V is not used if TAU = 0.
54 1 pfleura2
*
55 1 pfleura2
*  INCV    (input) INTEGER
56 1 pfleura2
*          The increment between elements of v. INCV <> 0.
57 1 pfleura2
*
58 1 pfleura2
*  TAU     (input) DOUBLE PRECISION
59 1 pfleura2
*          The value tau in the representation of H.
60 1 pfleura2
*
61 1 pfleura2
*  C       (input/output) DOUBLE PRECISION array, dimension (LDC,N)
62 1 pfleura2
*          On entry, the M-by-N matrix C.
63 1 pfleura2
*          On exit, C is overwritten by the matrix H * C if SIDE = 'L',
64 1 pfleura2
*          or C * H if SIDE = 'R'.
65 1 pfleura2
*
66 1 pfleura2
*  LDC     (input) INTEGER
67 1 pfleura2
*          The leading dimension of the array C. LDC >= max(1,M).
68 1 pfleura2
*
69 1 pfleura2
*  WORK    (workspace) DOUBLE PRECISION array, dimension
70 1 pfleura2
*                         (N) if SIDE = 'L'
71 1 pfleura2
*                      or (M) if SIDE = 'R'
72 1 pfleura2
*
73 1 pfleura2
*  Further Details
74 1 pfleura2
*  ===============
75 1 pfleura2
*
76 1 pfleura2
*  Based on contributions by
77 1 pfleura2
*    A. Petitet, Computer Science Dept., Univ. of Tenn., Knoxville, USA
78 1 pfleura2
*
79 1 pfleura2
*  =====================================================================
80 1 pfleura2
*
81 1 pfleura2
*     .. Parameters ..
82 1 pfleura2
      DOUBLE PRECISION   ONE, ZERO
83 1 pfleura2
      PARAMETER          ( ONE = 1.0D+0, ZERO = 0.0D+0 )
84 1 pfleura2
*     ..
85 1 pfleura2
*     .. External Subroutines ..
86 1 pfleura2
      EXTERNAL           DAXPY, DCOPY, DGEMV, DGER
87 1 pfleura2
*     ..
88 1 pfleura2
*     .. External Functions ..
89 1 pfleura2
      LOGICAL            LSAME
90 1 pfleura2
      EXTERNAL           LSAME
91 1 pfleura2
*     ..
92 1 pfleura2
*     .. Executable Statements ..
93 1 pfleura2
*
94 1 pfleura2
      IF( LSAME( SIDE, 'L' ) ) THEN
95 1 pfleura2
*
96 1 pfleura2
*        Form  H * C
97 1 pfleura2
*
98 1 pfleura2
         IF( TAU.NE.ZERO ) THEN
99 1 pfleura2
*
100 1 pfleura2
*           w( 1:n ) = C( 1, 1:n )
101 1 pfleura2
*
102 1 pfleura2
            CALL DCOPY( N, C, LDC, WORK, 1 )
103 1 pfleura2
*
104 1 pfleura2
*           w( 1:n ) = w( 1:n ) + C( m-l+1:m, 1:n )' * v( 1:l )
105 1 pfleura2
*
106 1 pfleura2
            CALL DGEMV( 'Transpose', L, N, ONE, C( M-L+1, 1 ), LDC, V,
107 1 pfleura2
     $                  INCV, ONE, WORK, 1 )
108 1 pfleura2
*
109 1 pfleura2
*           C( 1, 1:n ) = C( 1, 1:n ) - tau * w( 1:n )
110 1 pfleura2
*
111 1 pfleura2
            CALL DAXPY( N, -TAU, WORK, 1, C, LDC )
112 1 pfleura2
*
113 1 pfleura2
*           C( m-l+1:m, 1:n ) = C( m-l+1:m, 1:n ) - ...
114 1 pfleura2
*                               tau * v( 1:l ) * w( 1:n )'
115 1 pfleura2
*
116 1 pfleura2
            CALL DGER( L, N, -TAU, V, INCV, WORK, 1, C( M-L+1, 1 ),
117 1 pfleura2
     $                 LDC )
118 1 pfleura2
         END IF
119 1 pfleura2
*
120 1 pfleura2
      ELSE
121 1 pfleura2
*
122 1 pfleura2
*        Form  C * H
123 1 pfleura2
*
124 1 pfleura2
         IF( TAU.NE.ZERO ) THEN
125 1 pfleura2
*
126 1 pfleura2
*           w( 1:m ) = C( 1:m, 1 )
127 1 pfleura2
*
128 1 pfleura2
            CALL DCOPY( M, C, 1, WORK, 1 )
129 1 pfleura2
*
130 1 pfleura2
*           w( 1:m ) = w( 1:m ) + C( 1:m, n-l+1:n, 1:n ) * v( 1:l )
131 1 pfleura2
*
132 1 pfleura2
            CALL DGEMV( 'No transpose', M, L, ONE, C( 1, N-L+1 ), LDC,
133 1 pfleura2
     $                  V, INCV, ONE, WORK, 1 )
134 1 pfleura2
*
135 1 pfleura2
*           C( 1:m, 1 ) = C( 1:m, 1 ) - tau * w( 1:m )
136 1 pfleura2
*
137 1 pfleura2
            CALL DAXPY( M, -TAU, WORK, 1, C, 1 )
138 1 pfleura2
*
139 1 pfleura2
*           C( 1:m, n-l+1:n ) = C( 1:m, n-l+1:n ) - ...
140 1 pfleura2
*                               tau * w( 1:m ) * v( 1:l )'
141 1 pfleura2
*
142 1 pfleura2
            CALL DGER( M, L, -TAU, WORK, 1, V, INCV, C( 1, N-L+1 ),
143 1 pfleura2
     $                 LDC )
144 1 pfleura2
*
145 1 pfleura2
         END IF
146 1 pfleura2
*
147 1 pfleura2
      END IF
148 1 pfleura2
*
149 1 pfleura2
      RETURN
150 1 pfleura2
*
151 1 pfleura2
*     End of DLARZ
152 1 pfleura2
*
153 1 pfleura2
      END