LAPACK 3.3.0
|
00001 SUBROUTINE ZLARFY( 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*16 TAU 00011 * .. 00012 * .. Array Arguments .. 00013 COMPLEX*16 C( LDC, * ), V( * ), WORK( * ) 00014 * .. 00015 * 00016 * Purpose 00017 * ======= 00018 * 00019 * ZLARFY 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*16 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*16 00051 * The value tau as described above. 00052 * 00053 * C (input/output) COMPLEX*16 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*16 array, dimension (N) 00061 * 00062 * ===================================================================== 00063 * 00064 * .. Parameters .. 00065 COMPLEX*16 ONE, ZERO, HALF 00066 PARAMETER ( ONE = ( 1.0D+0, 0.0D+0 ), 00067 $ ZERO = ( 0.0D+0, 0.0D+0 ), 00068 $ HALF = ( 0.5D+0, 0.0D+0 ) ) 00069 * .. 00070 * .. Local Scalars .. 00071 COMPLEX*16 ALPHA 00072 * .. 00073 * .. External Subroutines .. 00074 EXTERNAL ZAXPY, ZHEMV, ZHER2 00075 * .. 00076 * .. External Functions .. 00077 COMPLEX*16 ZDOTC 00078 EXTERNAL ZDOTC 00079 * .. 00080 * .. Executable Statements .. 00081 * 00082 IF( TAU.EQ.ZERO ) 00083 $ RETURN 00084 * 00085 * Form w:= C * v 00086 * 00087 CALL ZHEMV( UPLO, N, ONE, C, LDC, V, INCV, ZERO, WORK, 1 ) 00088 * 00089 ALPHA = -HALF*TAU*ZDOTC( N, WORK, 1, V, INCV ) 00090 CALL ZAXPY( N, ALPHA, V, INCV, WORK, 1 ) 00091 * 00092 * C := C - v * w' - w * v' 00093 * 00094 CALL ZHER2( UPLO, N, -TAU, V, INCV, WORK, 1, C, LDC ) 00095 * 00096 RETURN 00097 * 00098 * End of ZLARFY 00099 * 00100 END