pub trait RealToComplexTransformsOps<T>: ToComplexResultwhere
T: RealNumber,{
fn to_complex(self) -> TransRes<Self::ComplexResult>;
}
Expand description
Defines transformations from real to complex number space.
Failures
All operations in this trait set self.len()
to 0
if the type isn’t in
the real number space.
Required Methods
sourcefn to_complex(self) -> TransRes<Self::ComplexResult>
fn to_complex(self) -> TransRes<Self::ComplexResult>
Converts the real vector into a complex vector.
Example
use basic_dsp_vector::*;
let vector = vec!(1.0, 2.0).to_real_time_vec();
let result = vector.to_complex().expect("Ignoring error handling in examples");
assert_eq!([Complex::new(1.0, 0.0), Complex::new(2.0, 0.0)], result[..]);