LAPACK 3.3.0

dlarfy.f

Go to the documentation of this file.
00001       SUBROUTINE DLARFY( 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       DOUBLE PRECISION   TAU
00011 *     ..
00012 *     .. Array Arguments ..
00013       DOUBLE PRECISION   C( LDC, * ), V( * ), WORK( * )
00014 *     ..
00015 *
00016 *  Purpose
00017 *  =======
00018 *
00019 *  DLARFY applies an elementary reflector, or Householder matrix, H,
00020 *  to an n x n symmetric 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 *          symmetric 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) DOUBLE PRECISION 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) DOUBLE PRECISION
00051 *          The value tau as described above.
00052 *
00053 *  C       (input/output) DOUBLE PRECISION 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) DOUBLE PRECISION array, dimension (N)
00061 *
00062 *  =====================================================================
00063 *
00064 *     .. Parameters ..
00065       DOUBLE PRECISION   ONE, ZERO, HALF
00066       PARAMETER          ( ONE = 1.0D+0, ZERO = 0.0D+0, HALF = 0.5D+0 )
00067 *     ..
00068 *     .. Local Scalars ..
00069       DOUBLE PRECISION   ALPHA
00070 *     ..
00071 *     .. External Subroutines ..
00072       EXTERNAL           DAXPY, DSYMV, DSYR2
00073 *     ..
00074 *     .. External Functions ..
00075       DOUBLE PRECISION   DDOT
00076       EXTERNAL           DDOT
00077 *     ..
00078 *     .. Executable Statements ..
00079 *
00080       IF( TAU.EQ.ZERO )
00081      $   RETURN
00082 *
00083 *     Form  w:= C * v
00084 *
00085       CALL DSYMV( UPLO, N, ONE, C, LDC, V, INCV, ZERO, WORK, 1 )
00086 *
00087       ALPHA = -HALF*TAU*DDOT( N, WORK, 1, V, INCV )
00088       CALL DAXPY( N, ALPHA, V, INCV, WORK, 1 )
00089 *
00090 *     C := C - v * w' - w * v'
00091 *
00092       CALL DSYR2( UPLO, N, -TAU, V, INCV, WORK, 1, C, LDC )
00093 *
00094       RETURN
00095 *
00096 *     End of DLARFY
00097 *
00098       END
 All Files Functions