Trait basic_dsp_vector::SplitOps
[−]
[src]
pub trait SplitOps { fn split_into(&self, targets: &mut [&mut Self]) -> VoidResult; }
Splits the data into several smaller pieces of equal size.
Required Methods
fn split_into(&self, targets: &mut [&mut Self]) -> VoidResult
Splits the vector into several smaller vectors. self.len()
must be dividable by
targets.len()
without a remainder and this condition must be true too
targets.len() > 0
.
Failures
TransRes may report the following ErrorReason
members:
InvalidArgumentLength
:self.points()
isn't dividable bytargets.len()
Example
use basic_dsp_vector::*; let mut vector = vec!(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0).to_real_time_vec(); let mut split = &mut [&mut Vec::new().to_real_time_vec(), &mut Vec::new().to_real_time_vec()]; vector.split_into(split).expect("Ignoring error handling in examples"); assert_eq!([1.0, 3.0, 5.0, 7.0, 9.0], split[0][..]);
Implementors
impl<S, T, N, D> SplitOps for DspVec<S, T, N, D> where
S: ToSliceMut<T>,
T: RealNumber,
N: NumberSpace,
D: Domain,