VecOps

Trait VecOps 

Source
pub trait VecOps<T: ComplexFloat> {
    // Required methods
    fn add_to_scaled<Lx: Layout, Ly: Layout>(
        &self,
        alpha: T,
        x: &DSlice<T, 1, Lx>,
        y: &mut DSlice<T, 1, Ly>,
    );
    fn dot<Lx: Layout, Ly: Layout>(
        &self,
        x: &DSlice<T, 1, Lx>,
        y: &DSlice<T, 1, Ly>,
    ) -> T;
    fn dotc<Lx: Layout, Ly: Layout>(
        &self,
        x: &DSlice<T, 1, Lx>,
        y: &DSlice<T, 1, Ly>,
    ) -> T;
    fn norm2<Lx: Layout>(&self, x: &DSlice<T, 1, Lx>) -> T::Real;
    fn norm1<Lx: Layout>(&self, x: &DSlice<T, 1, Lx>) -> T::Real
       where T: ComplexFloat;
    fn copy<Lx: Layout, Ly: Layout>(
        &self,
        x: &DSlice<T, 1, Lx>,
        y: &mut DSlice<T, 1, Ly>,
    );
    fn scal<Lx: Layout>(&self, alpha: T, x: &mut DSlice<T, 1, Lx>);
    fn swap<Lx: Layout, Ly: Layout>(
        &self,
        x: &mut DSlice<T, 1, Lx>,
        y: &mut DSlice<T, 1, Ly>,
    );
    fn rot<Lx: Layout, Ly: Layout>(
        &self,
        x: &mut DSlice<T, 1, Lx>,
        y: &mut DSlice<T, 1, Ly>,
        c: T::Real,
        s: T,
    )
       where T: ComplexFloat;
}
Expand description

Vector operations and basic linear algebra utilities

Required Methods§

Source

fn add_to_scaled<Lx: Layout, Ly: Layout>( &self, alpha: T, x: &DSlice<T, 1, Lx>, y: &mut DSlice<T, 1, Ly>, )

Accumulate a scaled vector: y := α·x + y

Source

fn dot<Lx: Layout, Ly: Layout>( &self, x: &DSlice<T, 1, Lx>, y: &DSlice<T, 1, Ly>, ) -> T

Dot product: ∑xᵢyᵢ

Source

fn dotc<Lx: Layout, Ly: Layout>( &self, x: &DSlice<T, 1, Lx>, y: &DSlice<T, 1, Ly>, ) -> T

Conjugated dot product: ∑(xᵢ * conj(yᵢ))

Source

fn norm2<Lx: Layout>(&self, x: &DSlice<T, 1, Lx>) -> T::Real

L2 norm: √(∑|xᵢ|²)

Source

fn norm1<Lx: Layout>(&self, x: &DSlice<T, 1, Lx>) -> T::Real
where T: ComplexFloat,

L1 norm: ∑|xᵢ|

Source

fn copy<Lx: Layout, Ly: Layout>( &self, x: &DSlice<T, 1, Lx>, y: &mut DSlice<T, 1, Ly>, )

Copy vector: y := x (TODO)

Source

fn scal<Lx: Layout>(&self, alpha: T, x: &mut DSlice<T, 1, Lx>)

Scale vector: x := α·xᵢ (TODO)

Source

fn swap<Lx: Layout, Ly: Layout>( &self, x: &mut DSlice<T, 1, Lx>, y: &mut DSlice<T, 1, Ly>, )

Swap vectors: x ↔ y (TODO)

Source

fn rot<Lx: Layout, Ly: Layout>( &self, x: &mut DSlice<T, 1, Lx>, y: &mut DSlice<T, 1, Ly>, c: T::Real, s: T, )
where T: ComplexFloat,

Givens rotation (TODO)

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.

Implementors§

Source§

impl<T: ComplexFloat + 'static + Add<Output = T> + Mul<Output = T> + Zero + Copy> VecOps<T> for Naive