josdejong/mathjs — pull request #136 by hamadu (2014-02-08 12:08:15+00:00)
Title: Faster matrix power

Hello.

I noticed that in math.js power of matrix (A^P, size(A)=N) code has computational complexity O(N^3P) that can be improved to O(N^3logP). Optimized code is included in my pull request. I also added some test cases in pow.test.js:

- power 0 of square matrix (A^0) test
- in original code it fails.

- power of larger size of square matrix test
- in original code it takes long (in my environment >= 10s) time.

I'd appreciate it if you could give me some feedback. Thanks.