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


swiftnav
Author(s):
autogenerated on Sat Jun 8 2019 18:55:47