26#define SQR(x) ((x)*(x))
27#define SQR_ABS(x) (SQR(real(x)) + SQR(imag(x)))
31int zheevq3(std::complex<double> A[3][3], std::complex<double> Q[3][3],
double w[3])
54 double g, r, p, f, b, s, c;
55 std::complex<double> t;
66 for (
int l=0; l < n-1; l++)
73 for (m=l; m <= n-2; m++)
75 g = fabs(w[m])+fabs(w[m+1]);
76 if (fabs(e[m]) + g == g)
86 g = (w[l+1] - w[l]) / (e[l] + e[l]);
87 r = sqrt(
SQR(g) + 1.0);
89 g = w[m] - w[l] + e[l]/(g + r);
91 g = w[m] - w[l] + e[l]/(g - r);
95 for (
int i=m-1; i >= l; i--)
99 if (fabs(f) > fabs(g))
102 r = sqrt(
SQR(c) + 1.0);
109 r = sqrt(
SQR(s) + 1.0);
115 r = (w[i] - g)*s + 2.0*c*b;
122 for (
int k=0; k < n; k++)
125 Q[k][i+1] = s*Q[k][i] + c*t;
126 Q[k][i] = c*Q[k][i] - s*t;
int zheevq3(std::complex< double > A[3][3], std::complex< double > Q[3][3], double w[3])
void zhetrd3(std::complex< double > A[3][3], std::complex< double > Q[3][3], double d[3], double e[2])