moved linalg function to GPy.linalg

This commit is contained in:
Nicolo Fusi 2013-05-13 17:04:59 +01:00
parent cbfbcfb411
commit 80c25c9aaf
3 changed files with 14 additions and 8 deletions

View file

@ -303,3 +303,8 @@ def cholupdate(L,x):
x = x.copy()
N = x.size
weave.inline(code, support_code=support_code, arg_names=['N','L','x'], type_converters=weave.converters.blitz)
def backsub_both_sides(L, X):
""" Return L^-T * X * L^-1, assumuing X is symmetrical and L is lower cholesky"""
tmp, _ = linalg.lapack.flapack.dtrtrs(L, np.asfortranarray(X), lower=1, trans=1)
return linalg.lapack.flapack.dtrtrs(L, np.asfortranarray(tmp.T), lower=1, trans=1)[0].T