WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit c41088c

Browse files
committed
HODLR in_place bug
1 parent 514ecab commit c41088c

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

george/hodlr.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ cdef class HODLRSolver:
8888
# Do an in-place solve if requested.
8989
if in_place:
9090
self.solver.apply_inverse(n, nrhs, <double*>y.data, <double*>y.data)
91-
return y
91+
return y.reshape(y0.shape)
9292

9393
# Do the standard solve.
9494
cdef np.ndarray[DTYPE_t, ndim=2] alpha = np.empty_like(y, dtype=DTYPE)

george/testing/test_gp.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,22 +56,22 @@ def _test_prediction(solver=BasicSolver):
5656
mu, cov = gp.predict(y, x)
5757

5858
assert np.allclose(y, mu), \
59-
"GP must predict noise-free training data exactly ({0})." \
60-
.format(solver.__name__)
59+
"GP must predict noise-free training data exactly ({0}).\n({1})" \
60+
.format(solver.__name__, y - mu)
6161

6262
assert np.all(cov > -1e-15), \
63-
"Covariance matrix must be nonnegative ({}).\n{}" \
63+
"Covariance matrix must be nonnegative ({0}).\n{1}" \
6464
.format(solver.__name__, cov)
6565

6666
var = np.diag(cov)
6767
assert np.allclose(var, 0), \
68-
"Variance must vanish at noise-free training points ({}).\n{}" \
68+
"Variance must vanish at noise-free training points ({0}).\n{1}" \
6969
.format(solver.__name__, var)
7070

7171
t = np.array((-.5, .3, 1.2))
7272
var = np.diag(gp.predict(y, t)[1])
7373
assert np.all(var > 0), \
74-
"Variance must be positive away from training points ({}).\n{}" \
74+
"Variance must be positive away from training points ({0}).\n{1}" \
7575
.format(solver.__name__, var)
7676

7777

0 commit comments

Comments
 (0)