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


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