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


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