[][src]Trait basic_dsp::DotProductOps

pub trait DotProductOps<A, R, T, N, D> where
    A: GetMetaData<T, N, D>,
    D: Domain,
    N: NumberSpace,
    T: RealNumber
{ type Output; fn dot_product(&self, factor: &A) -> Self::Output; }

An operation which multiplies each vector element with a constant

Associated Types

type Output

Loading content...

Required methods

fn dot_product(&self, factor: &A) -> Self::Output

Calculates the dot product of self and factor. Self and factor remain unchanged.

Example

use basic_dsp_vector::*;
let vector1 = vec!(2.0, 1.0, -1.0, 4.0).to_real_time_vec();
let vector2 = vec!(3.0, 4.0, -1.0, -2.0).to_real_time_vec();
let product = vector1.dot_product(&vector2).expect("Ignoring error handling in examples");
assert_eq!(3.0, product);
Loading content...

Implementors

impl<S, O, T, N, D, NO, DO> DotProductOps<O, Complex<T>, T, NO, DO> for DspVec<S, T, N, D> where
    D: Domain,
    DO: PosEq<D> + Domain,
    N: ComplexNumberSpace,
    NO: PosEq<N> + NumberSpace,
    O: Vector<T> + GetMetaData<T, NO, DO> + Index<RangeFull, Output = [T]>,
    S: ToSlice<T>,
    T: RealNumber
[src]

impl<S, O, T, N, D, NO, DO> DotProductOps<O, T, T, NO, DO> for DspVec<S, T, N, D> where
    D: Domain,
    DO: PosEq<D> + Domain,
    N: RealNumberSpace,
    NO: PosEq<N> + NumberSpace,
    O: Vector<T> + GetMetaData<T, NO, DO> + Index<RangeFull, Output = [T]>,
    S: ToSlice<T>,
    T: RealNumber
[src]

type Output = Result<T, ErrorReason>

impl<S, V, T, N, D> DotProductOps<Matrix2xN<V, S, T>, T, T, N, D> for Matrix2xN<V, S, T> where
    D: Domain,
    N: NumberSpace,
    S: ToSlice<T>,
    T: RealNumber,
    V: Vector<T> + DotProductOps<V, T, T, N, D, Output = Result<T, ErrorReason>> + GetMetaData<T, N, D>, 
[src]

type Output = Result<Vec<T>, ErrorReason>

impl<S, V, T, N, D> DotProductOps<Matrix3xN<V, S, T>, T, T, N, D> for Matrix3xN<V, S, T> where
    D: Domain,
    N: NumberSpace,
    S: ToSlice<T>,
    T: RealNumber,
    V: Vector<T> + DotProductOps<V, T, T, N, D, Output = Result<T, ErrorReason>> + GetMetaData<T, N, D>, 
[src]

type Output = Result<Vec<T>, ErrorReason>

impl<S, V, T, N, D> DotProductOps<Matrix4xN<V, S, T>, T, T, N, D> for Matrix4xN<V, S, T> where
    D: Domain,
    N: NumberSpace,
    S: ToSlice<T>,
    T: RealNumber,
    V: Vector<T> + DotProductOps<V, T, T, N, D, Output = Result<T, ErrorReason>> + GetMetaData<T, N, D>, 
[src]

type Output = Result<Vec<T>, ErrorReason>

impl<S, V, T, N, D> DotProductOps<MatrixMxN<V, S, T>, T, T, N, D> for MatrixMxN<V, S, T> where
    D: Domain,
    N: NumberSpace,
    S: ToSlice<T>,
    T: RealNumber,
    V: Vector<T> + DotProductOps<V, T, T, N, D, Output = Result<T, ErrorReason>> + GetMetaData<T, N, D>, 
[src]

type Output = Result<Vec<T>, ErrorReason>

impl<S, V, T, N, D> DotProductOps<V, T, T, N, D> for Matrix2xN<V, S, T> where
    D: Domain,
    N: NumberSpace,
    S: ToSlice<T>,
    T: RealNumber,
    V: Vector<T> + DotProductOps<V, T, T, N, D, Output = Result<T, ErrorReason>> + GetMetaData<T, N, D>, 
[src]

impl<S, V, T, N, D> DotProductOps<V, T, T, N, D> for Matrix3xN<V, S, T> where
    D: Domain,
    N: NumberSpace,
    S: ToSlice<T>,
    T: RealNumber,
    V: Vector<T> + DotProductOps<V, T, T, N, D, Output = Result<T, ErrorReason>> + GetMetaData<T, N, D>, 
[src]

impl<S, V, T, N, D> DotProductOps<V, T, T, N, D> for Matrix4xN<V, S, T> where
    D: Domain,
    N: NumberSpace,
    S: ToSlice<T>,
    T: RealNumber,
    V: Vector<T> + DotProductOps<V, T, T, N, D, Output = Result<T, ErrorReason>> + GetMetaData<T, N, D>, 
[src]

impl<S, V, T, N, D> DotProductOps<V, T, T, N, D> for MatrixMxN<V, S, T> where
    D: Domain,
    N: NumberSpace,
    S: ToSlice<T>,
    T: RealNumber,
    V: Vector<T> + DotProductOps<V, T, T, N, D, Output = Result<T, ErrorReason>> + GetMetaData<T, N, D>, 
[src]

type Output = Result<Vec<T>, ErrorReason>

Loading content...