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 doublecomplex c_b1 = {0.,0.};
00019 static doublecomplex c_b2 = {1.,0.};
00020 static integer c__3 = 3;
00021 static integer c__1 = 1;
00022
00023 int zlarge_(integer *n, doublecomplex *a, integer *lda,
00024 integer *iseed, doublecomplex *work, integer *info)
00025 {
00026
00027 integer a_dim1, a_offset, i__1;
00028 doublereal d__1;
00029 doublecomplex z__1;
00030
00031
00032 double z_abs(doublecomplex *);
00033 void z_div(doublecomplex *, doublecomplex *, doublecomplex *);
00034
00035
00036 integer i__;
00037 doublecomplex wa, wb;
00038 doublereal wn;
00039 doublecomplex tau;
00040 extern int zgerc_(integer *, integer *, doublecomplex *,
00041 doublecomplex *, integer *, doublecomplex *, integer *,
00042 doublecomplex *, integer *), zscal_(integer *, doublecomplex *,
00043 doublecomplex *, integer *), zgemv_(char *, integer *, integer *,
00044 doublecomplex *, doublecomplex *, integer *, doublecomplex *,
00045 integer *, doublecomplex *, doublecomplex *, integer *);
00046 extern doublereal dznrm2_(integer *, doublecomplex *, integer *);
00047 extern int xerbla_(char *, integer *), zlarnv_(
00048 integer *, integer *, integer *, doublecomplex *);
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
00108
00109 a_dim1 = *lda;
00110 a_offset = 1 + a_dim1;
00111 a -= a_offset;
00112 --iseed;
00113 --work;
00114
00115
00116 *info = 0;
00117 if (*n < 0) {
00118 *info = -1;
00119 } else if (*lda < max(1,*n)) {
00120 *info = -3;
00121 }
00122 if (*info < 0) {
00123 i__1 = -(*info);
00124 xerbla_("ZLARGE", &i__1);
00125 return 0;
00126 }
00127
00128
00129
00130 for (i__ = *n; i__ >= 1; --i__) {
00131
00132
00133
00134 i__1 = *n - i__ + 1;
00135 zlarnv_(&c__3, &iseed[1], &i__1, &work[1]);
00136 i__1 = *n - i__ + 1;
00137 wn = dznrm2_(&i__1, &work[1], &c__1);
00138 d__1 = wn / z_abs(&work[1]);
00139 z__1.r = d__1 * work[1].r, z__1.i = d__1 * work[1].i;
00140 wa.r = z__1.r, wa.i = z__1.i;
00141 if (wn == 0.) {
00142 tau.r = 0., tau.i = 0.;
00143 } else {
00144 z__1.r = work[1].r + wa.r, z__1.i = work[1].i + wa.i;
00145 wb.r = z__1.r, wb.i = z__1.i;
00146 i__1 = *n - i__;
00147 z_div(&z__1, &c_b2, &wb);
00148 zscal_(&i__1, &z__1, &work[2], &c__1);
00149 work[1].r = 1., work[1].i = 0.;
00150 z_div(&z__1, &wb, &wa);
00151 d__1 = z__1.r;
00152 tau.r = d__1, tau.i = 0.;
00153 }
00154
00155
00156
00157 i__1 = *n - i__ + 1;
00158 zgemv_("Conjugate transpose", &i__1, n, &c_b2, &a[i__ + a_dim1], lda,
00159 &work[1], &c__1, &c_b1, &work[*n + 1], &c__1);
00160 i__1 = *n - i__ + 1;
00161 z__1.r = -tau.r, z__1.i = -tau.i;
00162 zgerc_(&i__1, n, &z__1, &work[1], &c__1, &work[*n + 1], &c__1, &a[i__
00163 + a_dim1], lda);
00164
00165
00166
00167 i__1 = *n - i__ + 1;
00168 zgemv_("No transpose", n, &i__1, &c_b2, &a[i__ * a_dim1 + 1], lda, &
00169 work[1], &c__1, &c_b1, &work[*n + 1], &c__1);
00170 i__1 = *n - i__ + 1;
00171 z__1.r = -tau.r, z__1.i = -tau.i;
00172 zgerc_(n, &i__1, &z__1, &work[*n + 1], &c__1, &work[1], &c__1, &a[i__
00173 * a_dim1 + 1], lda);
00174
00175 }
00176 return 0;
00177
00178
00179
00180 }