LAPACK 3.3.0

clarfy.f

Go to the documentation of this file.
00001       SUBROUTINE CLARFY( UPLO, N, V, INCV, TAU, C, LDC, WORK )
00002 *
00003 *  -- LAPACK auxiliary test routine (version 3.1) --
00004 *     Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
00005 *     November 2006
00006 *
00007 *     .. Scalar Arguments ..
00008       CHARACTER          UPLO
00009       INTEGER            INCV, LDC, N
00010       COMPLEX            TAU
00011 *     ..
00012 *     .. Array Arguments ..
00013       COMPLEX            C( LDC, * ), V( * ), WORK( * )
00014 *     ..
00015 *
00016 *  Purpose
00017 *  =======
00018 *
00019 *  CLARFY applies an elementary reflector, or Householder matrix, H,
00020 *  to an n x n Hermitian matrix C, from both the left and the right.
00021 *
00022 *  H is represented in the form
00023 *
00024 *     H = I - tau * v * v'
00025 *
00026 *  where  tau  is a scalar and  v  is a vector.
00027 *
00028 *  If  tau  is  zero, then  H  is taken to be the unit matrix.
00029 *
00030 *  Arguments
00031 *  =========
00032 *
00033 *  UPLO    (input) CHARACTER*1
00034 *          Specifies whether the upper or lower triangular part of the
00035 *          Hermitian matrix C is stored.
00036 *          = 'U':  Upper triangle
00037 *          = 'L':  Lower triangle
00038 *
00039 *  N       (input) INTEGER
00040 *          The number of rows and columns of the matrix C.  N >= 0.
00041 *
00042 *  V       (input) COMPLEX array, dimension
00043 *                  (1 + (N-1)*abs(INCV))
00044 *          The vector v as described above.
00045 *
00046 *  INCV    (input) INTEGER
00047 *          The increment between successive elements of v.  INCV must
00048 *          not be zero.
00049 *
00050 *  TAU     (input) COMPLEX
00051 *          The value tau as described above.
00052 *
00053 *  C       (input/output) COMPLEX array, dimension (LDC, N)
00054 *          On entry, the matrix C.
00055 *          On exit, C is overwritten by H * C * H'.
00056 *
00057 *  LDC     (input) INTEGER
00058 *          The leading dimension of the array C.  LDC >= max( 1, N ).
00059 *
00060 *  WORK    (workspace) COMPLEX array, dimension (N)
00061 *
00062 *  =====================================================================
00063 *
00064 *     .. Parameters ..
00065       COMPLEX            ONE, ZERO, HALF
00066       PARAMETER          ( ONE = ( 1.0E+0, 0.0E+0 ),
00067      $                   ZERO = ( 0.0E+0, 0.0E+0 ),
00068      $                   HALF = ( 0.5E+0, 0.0E+0 ) )
00069 *     ..
00070 *     .. Local Scalars ..
00071       COMPLEX            ALPHA
00072 *     ..
00073 *     .. External Subroutines ..
00074       EXTERNAL           CAXPY, CHEMV, CHER2
00075 *     ..
00076 *     .. External Functions ..
00077       COMPLEX            CDOTC
00078       EXTERNAL           CDOTC
00079 *     ..
00080 *     .. Executable Statements ..
00081 *
00082       IF( TAU.EQ.ZERO )
00083      $   RETURN
00084 *
00085 *     Form  w:= C * v
00086 *
00087       CALL CHEMV( UPLO, N, ONE, C, LDC, V, INCV, ZERO, WORK, 1 )
00088 *
00089       ALPHA = -HALF*TAU*CDOTC( N, WORK, 1, V, INCV )
00090       CALL CAXPY( N, ALPHA, V, INCV, WORK, 1 )
00091 *
00092 *     C := C - v * w' - w * v'
00093 *
00094       CALL CHER2( UPLO, N, -TAU, V, INCV, WORK, 1, C, LDC )
00095 *
00096       RETURN
00097 *
00098 *     End of CLARFY
00099 *
00100       END
 All Files Functions