From 5366d18fc290c64c1ccb240654f116e0864bfa47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=A5rd=20Skaflestad?= Date: Wed, 8 Sep 2010 09:09:34 +0000 Subject: [PATCH] Correct embarrassing indexing error: Both the fine-scale ip-contributions and the resulting coarse-scale ip matrix have dimensions (number of basis functions)-by-(number of basis functions). --- coarse_sys.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/coarse_sys.c b/coarse_sys.c index 8b1f0d97..2857a68e 100644 --- a/coarse_sys.c +++ b/coarse_sys.c @@ -178,7 +178,7 @@ coarse_sys_compute_cell_ip(int nc, p = sys->ip_pos[b] + i*nbf_pairs; for (i2 = 0; i2 < nbf; i2++) { for (i1 = 0; i1 <= i2; i1++, p++) { - sys->cell_ip[p] = IP[i1 + i2*n]; + sys->cell_ip[p] = IP[i1 + i2*nbf]; } } @@ -245,6 +245,7 @@ coarse_sys_compute_Binv(int nb, Lti, &incx, &a2, B, &incy); /* Factor (packed) SPD inner-product matrix... */ + mm = nbf; dpptrf_("Upper Triangular", &mm, B, &info); if (info == 0) { /* ...and invert it... */