Swiftpack.co - Package - jaeseung16/MatrixExpmInSwift

# MatrixExp

MatrixExp is a Swift package for numerically evaluating matrix exponentiation.

### References

1. N. J. Higham, The scaling and squaring method for the matrix exponential revisited. SIAM J. Matrix Anal. Appl., 26(4), (2005), pp. 1179-1193. doi:10.1137/04061101X
2. A. H. Al-Mohy and N. J. Higham, A new scaling and squaring algorithm for the matrix exponential, SIAM J. Matrix Anal. Appl., 31(3), (2009), pp. 970-989. doi:10.1137/09074721X

### Usage

Initialize a matrix using LANumerics' `Matrix<Element>` and call `MatrixExp<Element>.evaluate(for:)`. The result can be `Matrix<Element>` or `nil`.

``````let M1 = Matrix<Double>(rows: [[0, 1], [1, 0]])
let result = MatrixExp<Double>.evaluate(for: M1)

let M2 = Matrix<Complex<Double>>(rows: [[Complex<Double>(0,0), Complex<Double>(0, -1)], [Complex<Double>(0, 1), Complex<Double>(0, 0)]])
let result = MatrixExp<Complex>.evaluate(for: M2)
``````

### TODO

Implement a function corresponding to `normest1` in Matlab or onenormest in Scipy to estimate the 1-norm of the powers of a given matrix [1]

[1] Nicholas J. Higham and Fran\c{c}oise Tisseur, A Block Algorithm for Matrix 1-Norm Estimation with an Application to 1-Norm Pseudospectra, SIAM J. Matrix Anal. App. 21, 1185-1201, 2000. doi: 10.1137/S0895479899356080