Trait basic_dsp::PreciseDotProductOps
source · pub trait PreciseDotProductOps<A, R, T, N, D>{
type Output;
// Required method
fn dot_product_prec(&self, factor: &A) -> Self::Output;
}
Expand description
An operation which multiplies each vector element with a constant
Required Associated Types§
Required Methods§
sourcefn dot_product_prec(&self, factor: &A) -> Self::Output
fn dot_product_prec(&self, factor: &A) -> Self::Output
Calculates the dot product of self and factor using a more precise but slower algorithm. 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_prec(&vector2).expect("Ignoring error handling in examples");
assert_eq!(3.0, product);