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