Trait basic_dsp::DotProductOps

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

An operation which multiplies each vector element with a constant

Required Associated Types§

Required Methods§

source

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);

Implementors§

source§

impl<S, O, T, N, D, NO, DO> DotProductOps<O, Complex<T>, T, NO, DO> for DspVec<S, T, N, D>
where S: ToSlice<T>, T: RealNumber, N: ComplexNumberSpace, D: Domain, O: Vector<T> + GetMetaData<T, NO, DO>, NO: PosEq<N> + NumberSpace, DO: PosEq<D> + Domain,

source§

impl<S, O, T, N, D, NO, DO> DotProductOps<O, T, T, NO, DO> for DspVec<S, T, N, D>
where S: ToSlice<T>, T: RealNumber, N: RealNumberSpace, D: Domain, O: Vector<T> + GetMetaData<T, NO, DO>, NO: PosEq<N> + NumberSpace, DO: PosEq<D> + Domain,

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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