12 static double tpi = 6.283185307179586;
14 static void uortho(
double *
g,
int n);
22 Cpx h, *v, *e, *p, *
r;
27 g = (
double *)calloc(n * n,
sizeof(
double));
28 v = (
Cpx *)calloc(m + n,
sizeof(
Cpx));
32 for (i = 0; i < n; ++i) {
41 for (i = 0; i < n; ++i) {
47 for (i = 0, p = v, q =
g; i < n; ++i) {
48 for (j = 0; j < n; ++j)
51 for (i = 0, p = v; i < n; ++i) {
52 for (j = 0, h = e[i]; j < n; ++j, ++p) {
59 for (i = m = 0, p = u; i < n; ++i, m += n) {
60 for (j = 0; j < n; ++j, ++p) {
62 for (k = 0, q =
g + m,
r = v + j; k < n; ++k,
r += n) {
64 p->
im += *q++ *
r->im;
72 static void uortho(
double *
g,
int n)
76 double *p, *q, c, s, a;
78 for (i = 0, p =
g; i < n; ++i) {
79 for (j = 0; j < n; ++j) {
86 for (i = 0, m = n - 1; i < m; ++i) {
87 for (j = i + 1; j < n; ++j) {
93 for (k = 0; k < n; ++k) {
void unitary(Cpx *u, int n)