Trait basic_dsp_vector::DotProductOps
[−]
[src]
pub trait DotProductOps<R, A>: Sized where R: Sized { type Output; fn dot_product(&self, factor: &A) -> Self::Output; }
An operation which multiplies each vector element with a constant
Associated Types
type Output
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);
Implementors
impl<S, T, N, D> DotProductOps<T, DspVec<S, T, N, D>> for DspVec<S, T, N, D> where S: ToSlice<T>, T: RealNumber, N: RealNumberSpace, D: Domain
impl<S, T, N, D> DotProductOps<Complex<T>, DspVec<S, T, N, D>> for DspVec<S, T, N, D> where S: ToSlice<T>, T: RealNumber, N: ComplexNumberSpace, D: Domain