sparse_complex
An abstraction layer for sparse21 that adds support for complex sparse matrices.
Complex Number representation
In this implementation, a complex number is represented as a tuple of f64
.
Where the first element is the real part and the second is the imaginary part, as shown bellow:
let complex_number: = // 1 + j1
The use of f64
is a limitation of sparse21.
Example
Lets consider the complex linear system bellow:
We can solve this system as follows:
use ComplexMatrix;
let mut a = new;
a.add_element;
a.add_element;
let b = ;
let solution = a.solve;
assert_eq!;
The solution of this system is:
Vesion Compatible
The sparse_complex
crate is tested for rustc 1.50 and greater.
License
MIT License. See LICENSE.