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


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