def cholesky_solve(matlist, variable, constant, K):
 new_matlist = copy.deepcopy(matlist)
 nrow = len(new_matlist)
 (L, Lstar) = cholesky(new_matlist, K)
 y = [[i] for i in symbols(('y:%i' % nrow))]
 forward_substitution(L, y, constant, K)
 backward_substitution(Lstar, variable, y, K)
 return variable

def cholesky_solve ( matlist , variable , constant , K ) : new_matlist = copy . deepcopy ( matlist ) nrow = len ( new_matlist ) ( L , Lstar ) = cholesky ( new_matlist , K ) y = [ [ i ] for i in symbols ( ( 'y:%i' % nrow ) ) ] forward_substitution ( L , y , constant , K ) backward_substitution ( Lstar , variable , y , K ) return variable
solves a system of equations using cholesky decomposition given a matrix of coefficients .