slarfy.c
Go to the documentation of this file.
00001 /* slarfy.f -- translated by f2c (version 20061008).
00002    You must link the resulting object file with libf2c:
00003         on Microsoft Windows system, link with libf2c.lib;
00004         on Linux or Unix systems, link with .../path/to/libf2c.a -lm
00005         or, if you install libf2c.a in a standard place, with -lf2c -lm
00006         -- in that order, at the end of the command line, as in
00007                 cc *.o -lf2c -lm
00008         Source for libf2c is in /netlib/f2c/libf2c.zip, e.g.,
00009 
00010                 http://www.netlib.org/f2c/libf2c.zip
00011 */
00012 
00013 #include "f2c.h"
00014 #include "blaswrap.h"
00015 
00016 /* Table of constant values */
00017 
00018 static real c_b2 = 1.f;
00019 static real c_b3 = 0.f;
00020 static integer c__1 = 1;
00021 
00022 /* Subroutine */ int slarfy_(char *uplo, integer *n, real *v, integer *incv, 
00023         real *tau, real *c__, integer *ldc, real *work)
00024 {
00025     /* System generated locals */
00026     integer c_dim1, c_offset;
00027     real r__1;
00028 
00029     /* Local variables */
00030     extern doublereal sdot_(integer *, real *, integer *, real *, integer *);
00031     extern /* Subroutine */ int ssyr2_(char *, integer *, real *, real *, 
00032             integer *, real *, integer *, real *, integer *);
00033     real alpha;
00034     extern /* Subroutine */ int saxpy_(integer *, real *, real *, integer *, 
00035             real *, integer *), ssymv_(char *, integer *, real *, real *, 
00036             integer *, real *, integer *, real *, real *, integer *);
00037 
00038 
00039 /*  -- LAPACK auxiliary test routine (version 3.1) -- */
00040 /*     Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. */
00041 /*     November 2006 */
00042 
00043 /*     .. Scalar Arguments .. */
00044 /*     .. */
00045 /*     .. Array Arguments .. */
00046 /*     .. */
00047 
00048 /*  Purpose */
00049 /*  ======= */
00050 
00051 /*  SLARFY applies an elementary reflector, or Householder matrix, H, */
00052 /*  to an n x n symmetric matrix C, from both the left and the right. */
00053 
00054 /*  H is represented in the form */
00055 
00056 /*     H = I - tau * v * v' */
00057 
00058 /*  where  tau  is a scalar and  v  is a vector. */
00059 
00060 /*  If  tau  is  zero, then  H  is taken to be the unit matrix. */
00061 
00062 /*  Arguments */
00063 /*  ========= */
00064 
00065 /*  UPLO    (input) CHARACTER*1 */
00066 /*          Specifies whether the upper or lower triangular part of the */
00067 /*          symmetric matrix C is stored. */
00068 /*          = 'U':  Upper triangle */
00069 /*          = 'L':  Lower triangle */
00070 
00071 /*  N       (input) INTEGER */
00072 /*          The number of rows and columns of the matrix C.  N >= 0. */
00073 
00074 /*  V       (input) REAL array, dimension */
00075 /*                  (1 + (N-1)*abs(INCV)) */
00076 /*          The vector v as described above. */
00077 
00078 /*  INCV    (input) INTEGER */
00079 /*          The increment between successive elements of v.  INCV must */
00080 /*          not be zero. */
00081 
00082 /*  TAU     (input) REAL */
00083 /*          The value tau as described above. */
00084 
00085 /*  C       (input/output) REAL array, dimension (LDC, N) */
00086 /*          On entry, the matrix C. */
00087 /*          On exit, C is overwritten by H * C * H'. */
00088 
00089 /*  LDC     (input) INTEGER */
00090 /*          The leading dimension of the array C.  LDC >= max( 1, N ). */
00091 
00092 /*  WORK    (workspace) REAL array, dimension (N) */
00093 
00094 /*  ===================================================================== */
00095 
00096 /*     .. Parameters .. */
00097 /*     .. */
00098 /*     .. Local Scalars .. */
00099 /*     .. */
00100 /*     .. External Subroutines .. */
00101 /*     .. */
00102 /*     .. External Functions .. */
00103 /*     .. */
00104 /*     .. Executable Statements .. */
00105 
00106     /* Parameter adjustments */
00107     --v;
00108     c_dim1 = *ldc;
00109     c_offset = 1 + c_dim1;
00110     c__ -= c_offset;
00111     --work;
00112 
00113     /* Function Body */
00114     if (*tau == 0.f) {
00115         return 0;
00116     }
00117 
00118 /*     Form  w:= C * v */
00119 
00120     ssymv_(uplo, n, &c_b2, &c__[c_offset], ldc, &v[1], incv, &c_b3, &work[1], 
00121             &c__1);
00122 
00123     alpha = *tau * -.5f * sdot_(n, &work[1], &c__1, &v[1], incv);
00124     saxpy_(n, &alpha, &v[1], incv, &work[1], &c__1);
00125 
00126 /*     C := C - v * w' - w * v' */
00127 
00128     r__1 = -(*tau);
00129     ssyr2_(uplo, n, &r__1, &v[1], incv, &work[1], &c__1, &c__[c_offset], ldc);
00130 
00131     return 0;
00132 
00133 /*     End of SLARFY */
00134 
00135 } /* slarfy_ */


swiftnav
Author(s):
autogenerated on Sat Jun 8 2019 18:56:11