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


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