slatzm.c
Go to the documentation of this file.
00001 /* slatzm.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 integer c__1 = 1;
00019 static real c_b5 = 1.f;
00020 
00021 /* Subroutine */ int slatzm_(char *side, integer *m, integer *n, real *v, 
00022         integer *incv, real *tau, real *c1, real *c2, integer *ldc, real *
00023         work)
00024 {
00025     /* System generated locals */
00026     integer c1_dim1, c1_offset, c2_dim1, c2_offset, i__1;
00027     real r__1;
00028 
00029     /* Local variables */
00030     extern /* Subroutine */ int sger_(integer *, integer *, real *, real *, 
00031             integer *, real *, integer *, real *, integer *);
00032     extern logical lsame_(char *, char *);
00033     extern /* Subroutine */ int sgemv_(char *, integer *, integer *, real *, 
00034             real *, integer *, real *, integer *, real *, real *, integer *), scopy_(integer *, real *, integer *, real *, integer *), 
00035             saxpy_(integer *, real *, real *, integer *, real *, integer *);
00036 
00037 
00038 /*  -- LAPACK routine (version 3.2) -- */
00039 /*     Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. */
00040 /*     November 2006 */
00041 
00042 /*     .. Scalar Arguments .. */
00043 /*     .. */
00044 /*     .. Array Arguments .. */
00045 /*     .. */
00046 
00047 /*  Purpose */
00048 /*  ======= */
00049 
00050 /*  This routine is deprecated and has been replaced by routine SORMRZ. */
00051 
00052 /*  SLATZM applies a Householder matrix generated by STZRQF to a matrix. */
00053 
00054 /*  Let P = I - tau*u*u',   u = ( 1 ), */
00055 /*                              ( v ) */
00056 /*  where v is an (m-1) vector if SIDE = 'L', or a (n-1) vector if */
00057 /*  SIDE = 'R'. */
00058 
00059 /*  If SIDE equals 'L', let */
00060 /*         C = [ C1 ] 1 */
00061 /*             [ C2 ] m-1 */
00062 /*               n */
00063 /*  Then C is overwritten by P*C. */
00064 
00065 /*  If SIDE equals 'R', let */
00066 /*         C = [ C1, C2 ] m */
00067 /*                1  n-1 */
00068 /*  Then C is overwritten by C*P. */
00069 
00070 /*  Arguments */
00071 /*  ========= */
00072 
00073 /*  SIDE    (input) CHARACTER*1 */
00074 /*          = 'L': form P * C */
00075 /*          = 'R': form C * P */
00076 
00077 /*  M       (input) INTEGER */
00078 /*          The number of rows of the matrix C. */
00079 
00080 /*  N       (input) INTEGER */
00081 /*          The number of columns of the matrix C. */
00082 
00083 /*  V       (input) REAL array, dimension */
00084 /*                  (1 + (M-1)*abs(INCV)) if SIDE = 'L' */
00085 /*                  (1 + (N-1)*abs(INCV)) if SIDE = 'R' */
00086 /*          The vector v in the representation of P. V is not used */
00087 /*          if TAU = 0. */
00088 
00089 /*  INCV    (input) INTEGER */
00090 /*          The increment between elements of v. INCV <> 0 */
00091 
00092 /*  TAU     (input) REAL */
00093 /*          The value tau in the representation of P. */
00094 
00095 /*  C1      (input/output) REAL array, dimension */
00096 /*                         (LDC,N) if SIDE = 'L' */
00097 /*                         (M,1)   if SIDE = 'R' */
00098 /*          On entry, the n-vector C1 if SIDE = 'L', or the m-vector C1 */
00099 /*          if SIDE = 'R'. */
00100 
00101 /*          On exit, the first row of P*C if SIDE = 'L', or the first */
00102 /*          column of C*P if SIDE = 'R'. */
00103 
00104 /*  C2      (input/output) REAL array, dimension */
00105 /*                         (LDC, N)   if SIDE = 'L' */
00106 /*                         (LDC, N-1) if SIDE = 'R' */
00107 /*          On entry, the (m - 1) x n matrix C2 if SIDE = 'L', or the */
00108 /*          m x (n - 1) matrix C2 if SIDE = 'R'. */
00109 
00110 /*          On exit, rows 2:m of P*C if SIDE = 'L', or columns 2:m of C*P */
00111 /*          if SIDE = 'R'. */
00112 
00113 /*  LDC     (input) INTEGER */
00114 /*          The leading dimension of the arrays C1 and C2. LDC >= (1,M). */
00115 
00116 /*  WORK    (workspace) REAL array, dimension */
00117 /*                      (N) if SIDE = 'L' */
00118 /*                      (M) if SIDE = 'R' */
00119 
00120 /*  ===================================================================== */
00121 
00122 /*     .. Parameters .. */
00123 /*     .. */
00124 /*     .. External Subroutines .. */
00125 /*     .. */
00126 /*     .. External Functions .. */
00127 /*     .. */
00128 /*     .. Intrinsic Functions .. */
00129 /*     .. */
00130 /*     .. Executable Statements .. */
00131 
00132     /* Parameter adjustments */
00133     --v;
00134     c2_dim1 = *ldc;
00135     c2_offset = 1 + c2_dim1;
00136     c2 -= c2_offset;
00137     c1_dim1 = *ldc;
00138     c1_offset = 1 + c1_dim1;
00139     c1 -= c1_offset;
00140     --work;
00141 
00142     /* Function Body */
00143     if (min(*m,*n) == 0 || *tau == 0.f) {
00144         return 0;
00145     }
00146 
00147     if (lsame_(side, "L")) {
00148 
00149 /*        w := C1 + v' * C2 */
00150 
00151         scopy_(n, &c1[c1_offset], ldc, &work[1], &c__1);
00152         i__1 = *m - 1;
00153         sgemv_("Transpose", &i__1, n, &c_b5, &c2[c2_offset], ldc, &v[1], incv, 
00154                  &c_b5, &work[1], &c__1);
00155 
00156 /*        [ C1 ] := [ C1 ] - tau* [ 1 ] * w' */
00157 /*        [ C2 ]    [ C2 ]        [ v ] */
00158 
00159         r__1 = -(*tau);
00160         saxpy_(n, &r__1, &work[1], &c__1, &c1[c1_offset], ldc);
00161         i__1 = *m - 1;
00162         r__1 = -(*tau);
00163         sger_(&i__1, n, &r__1, &v[1], incv, &work[1], &c__1, &c2[c2_offset], 
00164                 ldc);
00165 
00166     } else if (lsame_(side, "R")) {
00167 
00168 /*        w := C1 + C2 * v */
00169 
00170         scopy_(m, &c1[c1_offset], &c__1, &work[1], &c__1);
00171         i__1 = *n - 1;
00172         sgemv_("No transpose", m, &i__1, &c_b5, &c2[c2_offset], ldc, &v[1], 
00173                 incv, &c_b5, &work[1], &c__1);
00174 
00175 /*        [ C1, C2 ] := [ C1, C2 ] - tau* w * [ 1 , v'] */
00176 
00177         r__1 = -(*tau);
00178         saxpy_(m, &r__1, &work[1], &c__1, &c1[c1_offset], &c__1);
00179         i__1 = *n - 1;
00180         r__1 = -(*tau);
00181         sger_(m, &i__1, &r__1, &work[1], &c__1, &v[1], incv, &c2[c2_offset], 
00182                 ldc);
00183     }
00184 
00185     return 0;
00186 
00187 /*     End of SLATZM */
00188 
00189 } /* slatzm_ */


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