Compute the matrix cosine.
This routine uses expm to compute the matrix exponentials.
A : array, shape(M,M)
cosA : array, shape(M,M)
Matrix cosine of A
scipy.linalg.logm
scipy.linalg.sinm