ComplexSequence

Trait ComplexSequence 

Source
pub trait ComplexSequence {
    // Required methods
    fn apply(&mut self, f: impl FnMut(Complex<f64>) -> Complex<f64>);
    fn apply_into<T>(&self, out: &mut [T], f: impl FnMut(Complex<f64>) -> T);

    // Provided methods
    fn phase(&mut self, θ: f64) { ... }
    fn re(&self, out: &mut [f64]) { ... }
}
Expand description

An extension trait adding utility functions to lists of complex numbers.

Required Methods§

Source

fn apply(&mut self, f: impl FnMut(Complex<f64>) -> Complex<f64>)

Apply a function componentwise on each complex number.

Source

fn apply_into<T>(&self, out: &mut [T], f: impl FnMut(Complex<f64>) -> T)

Apply a function componentwise on each complex number and copy the output to the out array.

§Panics

The buffer of complex numbers must be the same length out.

Provided Methods§

Source

fn phase(&mut self, θ: f64)

Multiply each value in the sequence by e^iθ, rotating the phase by θ radians.

Source

fn re(&self, out: &mut [f64])

Copy the real part of each value into out.

§Panics

The buffer of complex numbers must be the same length as out.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl ComplexSequence for [Complex<f64>]

Source§

fn apply(&mut self, f: impl FnMut(Complex<f64>) -> Complex<f64>)

Source§

fn apply_into<T>(&self, out: &mut [T], f: impl FnMut(Complex<f64>) -> T)

Implementors§