s = svd(A, compute_uv=False)
// Scaling and squaring cannot deal with a singular matrix.
if not s[-1]:
return np.zeros_like(A)
// Compute the condition number relative to matrix inversion.
k2 = s[0] / s[-1]
p1 = p - np.floor(p)
p2 = p - np.ceil(p)
After Change
return np.zeros_like(A)
else:
p1 = p - np.floor(p)
a = int(np.floor(p))
b = p1
R, info = funm(A, lambda x : pow(x, b), disp=False)
Q = np.linalg.matrix_power(A, a)
return Q.dot(R)
def _logm_triu(T):