zrzt02.c
Go to the documentation of this file.
00001 /* zrzt02.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__7 = 7;
00019 static doublecomplex c_b5 = {0.,0.};
00020 static doublecomplex c_b6 = {1.,0.};
00021 
00022 doublereal zrzt02_(integer *m, integer *n, doublecomplex *af, integer *lda, 
00023         doublecomplex *tau, doublecomplex *work, integer *lwork)
00024 {
00025     /* System generated locals */
00026     integer af_dim1, af_offset, i__1, i__2, i__3;
00027     doublereal ret_val;
00028     doublecomplex z__1;
00029 
00030     /* Local variables */
00031     integer i__, info;
00032     doublereal rwork[1];
00033     extern doublereal dlamch_(char *);
00034     extern /* Subroutine */ int xerbla_(char *, integer *);
00035     extern doublereal zlange_(char *, integer *, integer *, doublecomplex *, 
00036             integer *, doublereal *);
00037     extern /* Subroutine */ int zlaset_(char *, integer *, integer *, 
00038             doublecomplex *, doublecomplex *, doublecomplex *, integer *), zunmrz_(char *, char *, integer *, integer *, integer *, 
00039             integer *, doublecomplex *, integer *, doublecomplex *, 
00040             doublecomplex *, integer *, doublecomplex *, integer *, integer *);
00041 
00042 
00043 /*  -- LAPACK test routine (version 3.1) -- */
00044 /*     Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. */
00045 /*     November 2006 */
00046 
00047 /*     .. Scalar Arguments .. */
00048 /*     .. */
00049 /*     .. Array Arguments .. */
00050 /*     .. */
00051 
00052 /*  Purpose */
00053 /*  ======= */
00054 
00055 /*  ZRZT02 returns */
00056 /*       || I - Q'*Q || / ( M * eps) */
00057 /*  where the matrix Q is defined by the Householder transformations */
00058 /*  generated by ZTZRZF. */
00059 
00060 /*  Arguments */
00061 /*  ========= */
00062 
00063 /*  M       (input) INTEGER */
00064 /*          The number of rows of the matrix AF. */
00065 
00066 /*  N       (input) INTEGER */
00067 /*          The number of columns of the matrix AF. */
00068 
00069 /*  AF      (input) COMPLEX*16 array, dimension (LDA,N) */
00070 /*          The output of ZTZRZF. */
00071 
00072 /*  LDA     (input) INTEGER */
00073 /*          The leading dimension of the array AF. */
00074 
00075 /*  TAU     (input) COMPLEX*16 array, dimension (M) */
00076 /*          Details of the Householder transformations as returned by */
00077 /*          ZTZRZF. */
00078 
00079 /*  WORK    (workspace) COMPLEX*16 array, dimension (LWORK) */
00080 
00081 /*  LWORK   (input) INTEGER */
00082 /*          Length of WORK array. LWORK >= N*N+N. */
00083 
00084 /*  ===================================================================== */
00085 
00086 /*     .. Parameters .. */
00087 /*     .. */
00088 /*     .. Local Scalars .. */
00089 /*     .. */
00090 /*     .. Local Arrays .. */
00091 /*     .. */
00092 /*     .. External Functions .. */
00093 /*     .. */
00094 /*     .. External Subroutines .. */
00095 /*     .. */
00096 /*     .. Intrinsic Functions .. */
00097 /*     .. */
00098 /*     .. Executable Statements .. */
00099 
00100     /* Parameter adjustments */
00101     af_dim1 = *lda;
00102     af_offset = 1 + af_dim1;
00103     af -= af_offset;
00104     --tau;
00105     --work;
00106 
00107     /* Function Body */
00108     ret_val = 0.;
00109 
00110     if (*lwork < *n * *n + *n) {
00111         xerbla_("ZRZT02", &c__7);
00112         return ret_val;
00113     }
00114 
00115 /*     Quick return if possible */
00116 
00117     if (*m <= 0 || *n <= 0) {
00118         return ret_val;
00119     }
00120 
00121 /*     Q := I */
00122 
00123     zlaset_("Full", n, n, &c_b5, &c_b6, &work[1], n);
00124 
00125 /*     Q := P(1) * ... * P(m) * Q */
00126 
00127     i__1 = *n - *m;
00128     i__2 = *lwork - *n * *n;
00129     zunmrz_("Left", "No transpose", n, n, m, &i__1, &af[af_offset], lda, &tau[
00130             1], &work[1], n, &work[*n * *n + 1], &i__2, &info);
00131 
00132 /*     Q := P(m)' * ... * P(1)' * Q */
00133 
00134     i__1 = *n - *m;
00135     i__2 = *lwork - *n * *n;
00136     zunmrz_("Left", "Conjugate transpose", n, n, m, &i__1, &af[af_offset], 
00137             lda, &tau[1], &work[1], n, &work[*n * *n + 1], &i__2, &info);
00138 
00139 /*     Q := Q - I */
00140 
00141     i__1 = *n;
00142     for (i__ = 1; i__ <= i__1; ++i__) {
00143         i__2 = (i__ - 1) * *n + i__;
00144         i__3 = (i__ - 1) * *n + i__;
00145         z__1.r = work[i__3].r - 1., z__1.i = work[i__3].i;
00146         work[i__2].r = z__1.r, work[i__2].i = z__1.i;
00147 /* L10: */
00148     }
00149 
00150     ret_val = zlange_("One-norm", n, n, &work[1], n, rwork) / (
00151             dlamch_("Epsilon") * (doublereal) max(*m,*n));
00152     return ret_val;
00153 
00154 /*     End of ZRZT02 */
00155 
00156 } /* zrzt02_ */


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