00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #include "f2c.h"
00014 #include "blaswrap.h"
00015
00016
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
00026 integer af_dim1, af_offset, i__1, i__2, i__3;
00027 doublereal ret_val;
00028 doublecomplex z__1;
00029
00030
00031 integer i__, info;
00032 doublereal rwork[1];
00033 extern doublereal dlamch_(char *);
00034 extern int xerbla_(char *, integer *);
00035 extern doublereal zlange_(char *, integer *, integer *, doublecomplex *,
00036 integer *, doublereal *);
00037 extern 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
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101 af_dim1 = *lda;
00102 af_offset = 1 + af_dim1;
00103 af -= af_offset;
00104 --tau;
00105 --work;
00106
00107
00108 ret_val = 0.;
00109
00110 if (*lwork < *n * *n + *n) {
00111 xerbla_("ZRZT02", &c__7);
00112 return ret_val;
00113 }
00114
00115
00116
00117 if (*m <= 0 || *n <= 0) {
00118 return ret_val;
00119 }
00120
00121
00122
00123 zlaset_("Full", n, n, &c_b5, &c_b6, &work[1], n);
00124
00125
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
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
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
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
00155
00156 }