Trait basic_dsp_vector::ScaleOps

source ·
pub trait ScaleOps<T>: Sized
where T: Sized,
{ // Required method fn scale(&mut self, factor: T); }
Expand description

An operation which multiplies each vector element with a constant

Required Methods§

source

fn scale(&mut self, factor: T)

Multiplies the vector element with a scalar.

§Failures

self.len() to 0 if the vector isn’t in the complex number space but factor is complex.

§Example
use basic_dsp_vector::*;
let mut vector = vec!(1.0, 2.0).to_real_time_vec();
vector.scale(2.0);
assert_eq!([2.0, 4.0], vector[0..]);

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<S, T, D, N> ScaleOps<Complex<T>> for DspVec<S, T, N, D>

source§

impl<S, T, D, N> ScaleOps<T> for DspVec<S, T, N, D>
where S: ToSliceMut<T>, T: RealNumber, N: NumberSpace, D: Domain,