sparse_complex
An simple solver for sparse complex linear systems based on Eigen::SparseLU.
Complex Number representation
We use num::Complex to represent complex numbers. See num crate for more information.
Example
Lets consider the complex linear system bellow:
$$ \begin{bmatrix} 1 - j1 & 0\ 0 & -1 + j1 \end{bmatrix} \begin{bmatrix} x_1 \ x_2 \end{bmatrix}= \begin{bmatrix} 1 \ j1 \end{bmatrix} $$
We can solve this system as follows:
use Complex;
use ComplexMatrix;
let mut m = new;
m.add_element;
m.add_element;
let mut b = vec!;
m.solve.unwrap;
let expected = vec!;
assert_eq!;
The solution of this system is:
$$ \frac{1}{2} \begin{bmatrix} 1 + j1 \ 1 - j1 \end{bmatrix} $$
Version Compatible
The sparse_complex crate is tested for rustc 1.61 and greater.
License
MIT License. See LICENSE.
sparse_complex also depends on Eigen v3.4.0 which is licensed under MPL v2.0. The source code of Eigen can be found on Eigen's Home Page.