Trait OffsetOps

Source
pub trait OffsetOps<T>: Sized
where T: Sized,
{ // Required method fn offset(&mut self, offset: T); }
Expand description

An operation which adds a constant to each vector element

Required Methods§

Source

fn offset(&mut self, offset: T)

Adds a scalar to each vector element.

§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.offset(2.0);
assert_eq!([3.0, 4.0], vector[0..]);

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

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

Source§

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