ComplexAmplitude

Trait ComplexAmplitude 

Source
pub trait ComplexAmplitude:
    Clone
    + Send
    + Sync {
    // Required methods
    fn to_complex64(&self) -> Complex64;
    fn from_complex64(c: Complex64) -> Self;
    fn norm_sqr(&self) -> f64;
    fn scale(&mut self, factor: f64);
}
Expand description

Trait for types that can represent complex amplitudes

Required Methods§

Source

fn to_complex64(&self) -> Complex64

Convert to Complex64 for computation

Source

fn from_complex64(c: Complex64) -> Self

Create from Complex64

Source

fn norm_sqr(&self) -> f64

Get norm squared

Source

fn scale(&mut self, factor: f64)

Multiply by scalar

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 ComplexAmplitude for Complex32

Source§

fn to_complex64(&self) -> Complex64

Source§

fn from_complex64(c: Complex64) -> Self

Source§

fn norm_sqr(&self) -> f64

Source§

fn scale(&mut self, factor: f64)

Implementors§