LAPACK  3.4.1
LAPACK: Linear Algebra PACKage
clarfy.f
Go to the documentation of this file.
00001 *> \brief \b CLARFY
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 CLARFY( UPLO, N, V, INCV, TAU, C, LDC, WORK )
00012 * 
00013 *       .. Scalar Arguments ..
00014 *       CHARACTER          UPLO
00015 *       INTEGER            INCV, LDC, N
00016 *       COMPLEX            TAU
00017 *       ..
00018 *       .. Array Arguments ..
00019 *       COMPLEX            C( LDC, * ), V( * ), WORK( * )
00020 *       ..
00021 *  
00022 *
00023 *> \par Purpose:
00024 *  =============
00025 *>
00026 *> \verbatim
00027 *>
00028 *> CLARFY applies an elementary reflector, or Householder matrix, H,
00029 *> to an n x n Hermitian 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 *>          Hermitian 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 COMPLEX 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 COMPLEX
00075 *>          The value tau as described above.
00076 *> \endverbatim
00077 *>
00078 *> \param[in,out] C
00079 *> \verbatim
00080 *>          C is COMPLEX 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 COMPLEX 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 complex_eig
00107 *
00108 *  =====================================================================
00109       SUBROUTINE CLARFY( 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       COMPLEX            TAU
00120 *     ..
00121 *     .. Array Arguments ..
00122       COMPLEX            C( LDC, * ), V( * ), WORK( * )
00123 *     ..
00124 *
00125 *  =====================================================================
00126 *
00127 *     .. Parameters ..
00128       COMPLEX            ONE, ZERO, HALF
00129       PARAMETER          ( ONE = ( 1.0E+0, 0.0E+0 ),
00130      $                   ZERO = ( 0.0E+0, 0.0E+0 ),
00131      $                   HALF = ( 0.5E+0, 0.0E+0 ) )
00132 *     ..
00133 *     .. Local Scalars ..
00134       COMPLEX            ALPHA
00135 *     ..
00136 *     .. External Subroutines ..
00137       EXTERNAL           CAXPY, CHEMV, CHER2
00138 *     ..
00139 *     .. External Functions ..
00140       COMPLEX            CDOTC
00141       EXTERNAL           CDOTC
00142 *     ..
00143 *     .. Executable Statements ..
00144 *
00145       IF( TAU.EQ.ZERO )
00146      $   RETURN
00147 *
00148 *     Form  w:= C * v
00149 *
00150       CALL CHEMV( UPLO, N, ONE, C, LDC, V, INCV, ZERO, WORK, 1 )
00151 *
00152       ALPHA = -HALF*TAU*CDOTC( N, WORK, 1, V, INCV )
00153       CALL CAXPY( N, ALPHA, V, INCV, WORK, 1 )
00154 *
00155 *     C := C - v * w' - w * v'
00156 *
00157       CALL CHER2( UPLO, N, -TAU, V, INCV, WORK, 1, C, LDC )
00158 *
00159       RETURN
00160 *
00161 *     End of CLARFY
00162 *
00163       END
 All Files Functions