xisf/Complex.rs
1pub type Complex32 = Complex<f32>;
2pub type Complex64 = Complex<f64>;
3pub type fcomplex = Complex32;
4pub type dcomplex = Complex64;
5pub type complex = dcomplex;
6
7#[derive(PartialEq, Debug)]
8pub struct Complex<T> {
9 pub C: [T; 2],
10}
11
12impl<T> Complex<T> {
13 pub fn new(real: T, imaginary: T) -> Self {
14 Self {
15 C: [real, imaginary],
16 }
17 }
18}