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__8 = 8;
00019 static doublecomplex c_b6 = {0.,0.};
00020 static integer c__1 = 1;
00021 static doublecomplex c_b15 = {-1.,0.};
00022
00023 doublereal zrzt01_(integer *m, integer *n, doublecomplex *a, doublecomplex *
00024 af, integer *lda, doublecomplex *tau, doublecomplex *work, integer *
00025 lwork)
00026 {
00027
00028 integer a_dim1, a_offset, af_dim1, af_offset, i__1, i__2, i__3, i__4;
00029 doublereal ret_val;
00030
00031
00032 integer i__, j, info;
00033 doublereal norma, rwork[1];
00034 extern int zaxpy_(integer *, doublecomplex *,
00035 doublecomplex *, integer *, doublecomplex *, integer *);
00036 extern doublereal dlamch_(char *);
00037 extern int xerbla_(char *, integer *);
00038 extern doublereal zlange_(char *, integer *, integer *, doublecomplex *,
00039 integer *, doublereal *);
00040 extern int zlaset_(char *, integer *, integer *,
00041 doublecomplex *, doublecomplex *, doublecomplex *, integer *), zunmrz_(char *, char *, integer *, integer *, integer *,
00042 integer *, doublecomplex *, integer *, doublecomplex *,
00043 doublecomplex *, integer *, doublecomplex *, integer *, integer *);
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
00102
00103
00104
00105
00106
00107 af_dim1 = *lda;
00108 af_offset = 1 + af_dim1;
00109 af -= af_offset;
00110 a_dim1 = *lda;
00111 a_offset = 1 + a_dim1;
00112 a -= a_offset;
00113 --tau;
00114 --work;
00115
00116
00117 ret_val = 0.;
00118
00119 if (*lwork < *m * *n + *m) {
00120 xerbla_("ZRZT01", &c__8);
00121 return ret_val;
00122 }
00123
00124
00125
00126 if (*m <= 0 || *n <= 0) {
00127 return ret_val;
00128 }
00129
00130 norma = zlange_("One-norm", m, n, &a[a_offset], lda, rwork);
00131
00132
00133
00134 zlaset_("Full", m, n, &c_b6, &c_b6, &work[1], m);
00135 i__1 = *m;
00136 for (j = 1; j <= i__1; ++j) {
00137 i__2 = j;
00138 for (i__ = 1; i__ <= i__2; ++i__) {
00139 i__3 = (j - 1) * *m + i__;
00140 i__4 = i__ + j * af_dim1;
00141 work[i__3].r = af[i__4].r, work[i__3].i = af[i__4].i;
00142
00143 }
00144
00145 }
00146
00147
00148
00149 i__1 = *n - *m;
00150 i__2 = *lwork - *m * *n;
00151 zunmrz_("Right", "No tranpose", m, n, m, &i__1, &af[af_offset], lda, &tau[
00152 1], &work[1], m, &work[*m * *n + 1], &i__2, &info);
00153
00154
00155
00156 i__1 = *n;
00157 for (i__ = 1; i__ <= i__1; ++i__) {
00158 zaxpy_(m, &c_b15, &a[i__ * a_dim1 + 1], &c__1, &work[(i__ - 1) * *m +
00159 1], &c__1);
00160
00161 }
00162
00163 ret_val = zlange_("One-norm", m, n, &work[1], m, rwork);
00164
00165 ret_val /= dlamch_("Epsilon") * (doublereal) max(*m,*n);
00166 if (norma != 0.) {
00167 ret_val /= norma;
00168 }
00169
00170 return ret_val;
00171
00172
00173
00174 }