Trait basic_dsp_vector::FromVector

source ·
pub trait FromVector<T>
where T: RealNumber,
{ type Output; // Required method fn get(self) -> (Self::Output, usize); }
Expand description

Retrieves the underlying storage from a vector.

If you are working with std::vec::Vec then it’s recommended to use
Into instead of this one, as it’s more straightforward to use.

Required Associated Types§

source

type Output

Type of the underlying storage of a vector.

Required Methods§

source

fn get(self) -> (Self::Output, usize)

If you are working with std::vec::Vec then it’s recommended to use
Into instead of this one, as it’s more straightforward to use.

Gets the underlying storage and the number of elements which contain valid data. Therefore a caller should only use the first valid data elements from the storage. The remaining elements (if there are any) might have been allocated during the calculations but contain no useful information.

§Example
use basic_dsp_vector::*;
let v: Vec<Complex<f64>> = vec!(Complex::new(1.0, 2.0), Complex::new(3.0, 4.0));
let v: DspVec<Vec<f64>, f64, meta::Complex, meta::Time> = v.to_complex_time_vec();
let (v, p): (Vec<Complex<f64>>, usize) = v.get();
assert_eq!(2, p);
assert_eq!(vec!(Complex::new(1.0, 2.0), Complex::new(3.0, 4.0)), v);

Implementors§

source§

impl<'a, T, D> FromVector<T> for DspVec<&'a [T], T, Complex, D>
where T: RealNumber, D: Domain,

§

type Output = &'a [Complex<T>]

source§

impl<'a, T, D> FromVector<T> for DspVec<&'a mut [T], T, Complex, D>
where T: RealNumber, D: Domain,

§

type Output = &'a mut [Complex<T>]

source§

impl<S, T, D> FromVector<T> for DspVec<S, T, Real, D>
where S: ToSlice<T>, T: RealNumber, D: Domain,

§

type Output = S

source§

impl<T, D> FromVector<T> for DspVec<Vec<T>, T, Complex, D>
where T: RealNumber, D: Domain,

§

type Output = Vec<Complex<T>>