faer-rs
faer-rs copied to clipboard
Issues with complex support
Describe the bug
Hi :), I was fiddling around with faer
and found the support around complex numbers really confusing & slightly buggy.
-
Stack overflow on windows. The following code causes a stack overflow on windows (only in
dev
builds,release
works)use num_complex::Complex; let m = Mat::<Complex<f64>>::zeros(4, 3); let v = Mat::<Complex<f64>>::zeros(3, 1); let r = m * v; println!("{r:?}");
-
Additionally, for an unknown (to me) reason there is apparently no way to index a
Mat<Complex<f64>>
. The following code does not compile:let m = Mat::<Complex<f64>>::zeros(4, 3); let x = m[(0, 0)]; // trait error here
At least to me it is not at all apparent why this doesn't work. I haven't found anything in the documentation about it.
-
It took me a very long time to figure out that you are supposed to use
c64
instead ofComplex<f64>
. Adding an example or some more documentation how to use complex numbers would be appreciated.
Thx :)