1
       2
       3
       4
       5
       6
       7
       8
       9
      10
      11
      12
      13
      14
      15
      16
      17
      18
      19
      20
      21
      22
      23
      24
      25
      26
      27
      28
      29
      30
      31
      32
      33
      34
      35
      36
      37
      38
      39
      40
      41
      42
      43
      44
      45
      46
      47
      48
      49
      50
      51
      52
      53
      54
      55
      56
      57
      58
      59
      60
      61
      62
      63
      64
      65
      66
      67
      68
      69
      70
      71
      72
      73
      74
      75
      76
      77
      78
      79
      80
      81
      82
      83
      84
      85
      86
      87
      88
      89
      90
      91
      92
      93
      94
      95
      96
      97
      98
      99
     100
      SUBROUTINE ZLARFYUPLONVINCVTAUCLDCWORK )
*
*  -- LAPACK auxiliary test routine (version 3.1) --
*     Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
*     November 2006
*
*     .. Scalar Arguments ..
      CHARACTER          UPLO
      INTEGER            INCVLDCN
      COMPLEX*16         TAU
*     ..
*     .. Array Arguments ..
      COMPLEX*16         CLDC* ), V* ), WORK* )
*     ..
*
*  Purpose
*  =======
*
*  ZLARFY applies an elementary reflector, or Householder matrix, H,
*  to an n x n Hermitian matrix C, from both the left and the right.
*
*  H is represented in the form
*
*     H = I - tau * v * v'
*
*  where  tau  is a scalar and  v  is a vector.
*
*  If  tau  is  zero, then  H  is taken to be the unit matrix.
*
*  Arguments
*  =========
*
*  UPLO    (input) CHARACTER*1
*          Specifies whether the upper or lower triangular part of the
*          Hermitian matrix C is stored.
*          = 'U':  Upper triangle
*          = 'L':  Lower triangle
*
*  N       (input) INTEGER
*          The number of rows and columns of the matrix C.  N >= 0.
*
*  V       (input) COMPLEX*16 array, dimension
*                  (1 + (N-1)*abs(INCV))
*          The vector v as described above.
*
*  INCV    (input) INTEGER
*          The increment between successive elements of v.  INCV must
*          not be zero.
*
*  TAU     (input) COMPLEX*16
*          The value tau as described above.
*
*  C       (input/output) COMPLEX*16 array, dimension (LDC, N)
*          On entry, the matrix C.
*          On exit, C is overwritten by H * C * H'.
*
*  LDC     (input) INTEGER
*          The leading dimension of the array C.  LDC >= max( 1, N ).
*
*  WORK    (workspace) COMPLEX*16 array, dimension (N)
*
*  =====================================================================
*
*     .. Parameters ..
      COMPLEX*16         ONEZEROHALF
      PARAMETER          ( ONE = ( 1.0D+00.0D+0 ),
     $                   ZERO = ( 0.0D+00.0D+0 ),
     $                   HALF = ( 0.5D+00.0D+0 ) )
*     ..
*     .. Local Scalars ..
      COMPLEX*16         ALPHA
*     ..
*     .. External Subroutines ..
      EXTERNAL           ZAXPYZHEMVZHER2
*     ..
*     .. External Functions ..
      COMPLEX*16         ZDOTC
      EXTERNAL           ZDOTC
*     ..
*     .. Executable Statements ..
*
      IFTAU.EQ.ZERO )
     $   RETURN
*
*     Form  w:= C * v
*
      CALL ZHEMVUPLONONECLDCVINCVZEROWORK1 )
*
      ALPHA = -HALF*TAU*ZDOTCNWORK1VINCV )
      CALL ZAXPYNALPHAVINCVWORK1 )
*
*     C := C - v * w' - w * v'
*
      CALL ZHER2UPLON-TAUVINCVWORK1CLDC )
*
      RETURN
*
*     End of ZLARFY
*
      END