diff --git a/GPy/util/choleskies.py b/GPy/util/choleskies.py index 606229f7..c8c8227f 100644 --- a/GPy/util/choleskies.py +++ b/GPy/util/choleskies.py @@ -2,10 +2,9 @@ # Licensed under the GNU GPL version 3.0 import numpy as np -from scipy import weave +#from scipy import weave from . import linalg - def safe_root(N): i = np.sqrt(N) j = int(i) @@ -13,58 +12,58 @@ def safe_root(N): raise ValueError("N is not square!") return j -def flat_to_triang(flat): - """take a matrix N x D and return a M X M x D array where +#def flat_to_triang(flat): +# """take a matrix N x D and return a M X M x D array where +# +# N = M(M+1)/2 +# +# the lower triangluar portion of the d'th slice of the result is filled by the d'th column of flat. +# """ +# N, D = flat.shape +# M = (-1 + safe_root(8*N+1))/2 +# ret = np.zeros((M, M, D)) +# flat = np.ascontiguousarray(flat) +# +# code = """ +# int count = 0; +# for(int m=0; m