![]() |
LAPACK
3.4.1
LAPACK: Linear Algebra PACKage
|
00001 *> \brief \b SLARFY 00002 * 00003 * =========== DOCUMENTATION =========== 00004 * 00005 * Online html documentation available at 00006 * http://www.netlib.org/lapack/explore-html/ 00007 * 00008 * Definition: 00009 * =========== 00010 * 00011 * SUBROUTINE SLARFY( UPLO, N, V, INCV, TAU, C, LDC, WORK ) 00012 * 00013 * .. Scalar Arguments .. 00014 * CHARACTER UPLO 00015 * INTEGER INCV, LDC, N 00016 * REAL TAU 00017 * .. 00018 * .. Array Arguments .. 00019 * REAL C( LDC, * ), V( * ), WORK( * ) 00020 * .. 00021 * 00022 * 00023 *> \par Purpose: 00024 * ============= 00025 *> 00026 *> \verbatim 00027 *> 00028 *> SLARFY applies an elementary reflector, or Householder matrix, H, 00029 *> to an n x n symmetric matrix C, from both the left and the right. 00030 *> 00031 *> H is represented in the form 00032 *> 00033 *> H = I - tau * v * v' 00034 *> 00035 *> where tau is a scalar and v is a vector. 00036 *> 00037 *> If tau is zero, then H is taken to be the unit matrix. 00038 *> \endverbatim 00039 * 00040 * Arguments: 00041 * ========== 00042 * 00043 *> \param[in] UPLO 00044 *> \verbatim 00045 *> UPLO is CHARACTER*1 00046 *> Specifies whether the upper or lower triangular part of the 00047 *> symmetric matrix C is stored. 00048 *> = 'U': Upper triangle 00049 *> = 'L': Lower triangle 00050 *> \endverbatim 00051 *> 00052 *> \param[in] N 00053 *> \verbatim 00054 *> N is INTEGER 00055 *> The number of rows and columns of the matrix C. N >= 0. 00056 *> \endverbatim 00057 *> 00058 *> \param[in] V 00059 *> \verbatim 00060 *> V is REAL array, dimension 00061 *> (1 + (N-1)*abs(INCV)) 00062 *> The vector v as described above. 00063 *> \endverbatim 00064 *> 00065 *> \param[in] INCV 00066 *> \verbatim 00067 *> INCV is INTEGER 00068 *> The increment between successive elements of v. INCV must 00069 *> not be zero. 00070 *> \endverbatim 00071 *> 00072 *> \param[in] TAU 00073 *> \verbatim 00074 *> TAU is REAL 00075 *> The value tau as described above. 00076 *> \endverbatim 00077 *> 00078 *> \param[in,out] C 00079 *> \verbatim 00080 *> C is REAL array, dimension (LDC, N) 00081 *> On entry, the matrix C. 00082 *> On exit, C is overwritten by H * C * H'. 00083 *> \endverbatim 00084 *> 00085 *> \param[in] LDC 00086 *> \verbatim 00087 *> LDC is INTEGER 00088 *> The leading dimension of the array C. LDC >= max( 1, N ). 00089 *> \endverbatim 00090 *> 00091 *> \param[out] WORK 00092 *> \verbatim 00093 *> WORK is REAL array, dimension (N) 00094 *> \endverbatim 00095 * 00096 * Authors: 00097 * ======== 00098 * 00099 *> \author Univ. of Tennessee 00100 *> \author Univ. of California Berkeley 00101 *> \author Univ. of Colorado Denver 00102 *> \author NAG Ltd. 00103 * 00104 *> \date November 2011 00105 * 00106 *> \ingroup single_eig 00107 * 00108 * ===================================================================== 00109 SUBROUTINE SLARFY( UPLO, N, V, INCV, TAU, C, LDC, WORK ) 00110 * 00111 * -- LAPACK test routine (version 3.4.0) -- 00112 * -- LAPACK is a software package provided by Univ. of Tennessee, -- 00113 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- 00114 * November 2011 00115 * 00116 * .. Scalar Arguments .. 00117 CHARACTER UPLO 00118 INTEGER INCV, LDC, N 00119 REAL TAU 00120 * .. 00121 * .. Array Arguments .. 00122 REAL C( LDC, * ), V( * ), WORK( * ) 00123 * .. 00124 * 00125 * ===================================================================== 00126 * 00127 * .. Parameters .. 00128 REAL ONE, ZERO, HALF 00129 PARAMETER ( ONE = 1.0E+0, ZERO = 0.0E+0, HALF = 0.5E+0 ) 00130 * .. 00131 * .. Local Scalars .. 00132 REAL ALPHA 00133 * .. 00134 * .. External Subroutines .. 00135 EXTERNAL SAXPY, SSYMV, SSYR2 00136 * .. 00137 * .. External Functions .. 00138 REAL SDOT 00139 EXTERNAL SDOT 00140 * .. 00141 * .. Executable Statements .. 00142 * 00143 IF( TAU.EQ.ZERO ) 00144 $ RETURN 00145 * 00146 * Form w:= C * v 00147 * 00148 CALL SSYMV( UPLO, N, ONE, C, LDC, V, INCV, ZERO, WORK, 1 ) 00149 * 00150 ALPHA = -HALF*TAU*SDOT( N, WORK, 1, V, INCV ) 00151 CALL SAXPY( N, ALPHA, V, INCV, WORK, 1 ) 00152 * 00153 * C := C - v * w' - w * v' 00154 * 00155 CALL SSYR2( UPLO, N, -TAU, V, INCV, WORK, 1, C, LDC ) 00156 * 00157 RETURN 00158 * 00159 * End of SLARFY 00160 * 00161 END