MAINT: speed up expm a bit
MAINT: expm now works for numpy matrices as input, including a test
MAINT: move the code that computes the one-norm of a power of a non-negative matrix into its own function, and add a test
MAINT: fblas -> blas
MAINT: blas -> get_blas_funcs
MAINT: avoid redundant copying, now that the trmm wrapper has been fixed
Merge pull request #2887 from argriffing/maint-matfunc-trmm

ENH: sparse.linalg: expm maintenance

This PR speeds up expm a bit (from 40 seconds down to 34 seconds for an order 4k random.randn matrix, as an unofficial benchmark) and adds a test for numpy matrix input.

The speedup is mostly due to the correction of an earlier oversight where it was using a slow approximate way to get the 1-norm of a power of a positive matrix, but you can get this quickly and exactly. This was somewhat obfuscated in the original paper because in one place the exact formula was given, but with a missing transpose, and in another place the approximation was used instead, so this was confusing. Less importantly also using the newly added trmm for upper triangular matrices.

The expm function had no test for numpy matrices, but it happened to work. One way that numpy matrices differ from numpy ndarrays and scipy sparse matrices is that M.dot(M.dot(np.ones(M.shape[0]))) fails when M is a square numpy.matrix but works when M is a square numpy.ndarray or scipy.sparse matrix. So added a test for numpy.matrix input.