10 void house(
double *a,
double *d,
double *dp,
int n)
16 double *qw, *qs, *pc, *p;
18 qs = (
double *)calloc(2 * n,
sizeof(
double));
19 for (j = 0, qw = qs + n, pc = a; j < n; pc += n + 1)
21 for (j = 0, pc = a; j < n - 2; ++j, pc += n + 1) {
23 for (i = 1, sc = 0.; i <= m; ++i)
27 if ((
x = *(pc + 1)) < 0.) {
29 h = 1. / sqrt(-2. * sc * y);
33 h = 1. / sqrt(2. * sc * y);
36 for (i = 0, qw = pc + 1; i < m; ++i) {
43 for (i = 0, e = j + 2, p = pc + n + 1, h = 0.; i < m;
45 qs[i] += (y = qw[i]) * *p++;
46 for (k = i + 1; k < m; ++k) {
52 for (i = 0; i < m; ++i) {
56 for (i = 0, e = j + 2, p = pc + n + 1; i < m; ++i, p += e++) {
57 for (k = i; k < m; ++k)
58 *p++ -= qw[i] * qs[k] + qs[i] * qw[k];
66 d[j + 1] = *(pc + n + 1);
67 for (j = 0, pc = a, qw = qs + n; j < n; ++j, pc += n + 1) {
69 for (i = 1, p = pc + n; i < n - j; p += n)
void house(double *a, double *d, double *dp, int n)