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


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