// Use manopt method
return x.dot(sp.linalg.expm(sp.linalg.solve(x, u, sym_pos=True)))
else:
c = la.cholesky(x)c_inv = la.inv(c)
e = multiexp(multiprod(multiprod(c_inv, u), multitransp(c_inv)),
sym=True)
return multiprod(multiprod(c, e), multitransp(c))
After Change
e[i] = sp.linalg.expm(x_inv_u[i])
else:
e = sp.linalg.expm(x_inv_u)
return multiprod(x, e)
// This alternative implementation is sometimes faster though less
// stable. It can return a matrix with small negative determinant.
// c = la.cholesky(x)
// c_inv = la.inv(c)