def chol_add(L, A):
N = L.shape[0]
S12 = spla.solve_triangular(L, A[:N,N:], lower=True)
S22 = spla.cholesky(A[N:,N:] - S12.T.dot(S12)).T
L_update = np.zeros(A.shape)
L_update[:N,:N] = L
L_update[N:,:N] = S12.T
L_update[N:,N:] = S22
return L_update
评论列表
文章目录