Struct imbe::enhance::EnhancedSpectrals
[−]
[src]
pub struct EnhancedSpectrals(_);
Enhanced spectral amplitudes, "overbar" Ml, are derived from the decoded spectral amplitudes, "tilde" Ml.
Methods
impl EnhancedSpectrals
[src]
pub fn new(
spectrals: &Spectrals,
fen: &FrameEnergy,
params: &BaseParams
) -> EnhancedSpectrals
[src]
spectrals: &Spectrals,
fen: &FrameEnergy,
params: &BaseParams
) -> EnhancedSpectrals
Create a new EnhancedSpectrals
from the given base spectral amplitudes
Ml and current frame energy values and parameters.
pub fn get(&self, l: usize) -> f32
[src]
Retrieve the enhanced spectral amplitude Ml, 1 ≤ l ≤ L.
Methods from Deref<Target = ArrayVec<[f32; 56]>>
pub fn len(&self) -> usize
[src]
Return the number of elements in the ArrayVec
.
use arrayvec::ArrayVec; let mut array = ArrayVec::from([1, 2, 3]); array.pop(); assert_eq!(array.len(), 2);
pub fn capacity(&self) -> usize
[src]
Return the capacity of the ArrayVec
.
use arrayvec::ArrayVec; let array = ArrayVec::from([1, 2, 3]); assert_eq!(array.capacity(), 3);
pub fn is_full(&self) -> bool
[src]
Return if the ArrayVec
is completely filled.
use arrayvec::ArrayVec; let mut array = ArrayVec::<[_; 1]>::new(); assert!(!array.is_full()); array.push(1); assert!(array.is_full());
pub fn push(
&mut self,
element: <A as Array>::Item
) -> Option<<A as Array>::Item>
[src]
&mut self,
element: <A as Array>::Item
) -> Option<<A as Array>::Item>
Push element
to the end of the vector.
Return None
if the push succeeds, or and return Some(
element )
if the vector is full.
use arrayvec::ArrayVec; let mut array = ArrayVec::<[_; 2]>::new(); array.push(1); array.push(2); let overflow = array.push(3); assert_eq!(&array[..], &[1, 2]); assert_eq!(overflow, Some(3));
pub fn insert(
&mut self,
index: usize,
element: <A as Array>::Item
) -> Option<<A as Array>::Item>
[src]
&mut self,
index: usize,
element: <A as Array>::Item
) -> Option<<A as Array>::Item>
Insert element
in position index
.
Shift up all elements after index
. If any is pushed out, it is returned.
Return None
if no element is shifted out.
index
must be <= self.len()
and < self.capacity()
. Note that any
out of bounds index insert results in the element being "shifted out"
and returned directly.
use arrayvec::ArrayVec; let mut array = ArrayVec::<[_; 2]>::new(); assert_eq!(array.insert(0, "x"), None); assert_eq!(array.insert(0, "y"), None); assert_eq!(array.insert(0, "z"), Some("x")); assert_eq!(array.insert(1, "w"), Some("y")); assert_eq!(&array[..], &["z", "w"]);
pub fn pop(&mut self) -> Option<<A as Array>::Item>
[src]
Remove the last element in the vector.
Return Some(
element )
if the vector is non-empty, else None
.
use arrayvec::ArrayVec; let mut array = ArrayVec::<[_; 2]>::new(); array.push(1); assert_eq!(array.pop(), Some(1)); assert_eq!(array.pop(), None);
pub fn swap_remove(&mut self, index: usize) -> Option<<A as Array>::Item>
[src]
Remove the element at index
and swap the last element into its place.
This operation is O(1).
Return Some(
element )
if the index is in bounds, else None
.
use arrayvec::ArrayVec; let mut array = ArrayVec::from([1, 2, 3]); assert_eq!(array.swap_remove(0), Some(1)); assert_eq!(&array[..], &[3, 2]); assert_eq!(array.swap_remove(10), None);
pub fn remove(&mut self, index: usize) -> Option<<A as Array>::Item>
[src]
Remove the element at index
and shift down the following elements.
Return Some(
element )
if the index is in bounds, else None
.
use arrayvec::ArrayVec; let mut array = ArrayVec::from([1, 2, 3]); assert_eq!(array.remove(0), Some(1)); assert_eq!(&array[..], &[2, 3]); assert_eq!(array.remove(10), None);
pub fn clear(&mut self)
[src]
Remove all elements in the vector.
pub fn retain<F>(&mut self, f: F) where
F: FnMut(&mut <A as Array>::Item) -> bool,
[src]
F: FnMut(&mut <A as Array>::Item) -> bool,
Retains only the elements specified by the predicate.
In other words, remove all elements e
such that f(&mut e)
returns false.
This method operates in place and preserves the order of the retained
elements.
use arrayvec::ArrayVec; let mut array = ArrayVec::from([1, 2, 3, 4]); array.retain(|x| *x & 1 != 0 ); assert_eq!(&array[..], &[1, 3]);
pub unsafe fn set_len(&mut self, length: usize)
[src]
Set the vector's length without dropping or moving out elements
May panic if length
is greater than the capacity.
This function is unsafe
because it changes the notion of the
number of “valid” elements in the vector. Use with care.
ⓘImportant traits for Drain<'a, A>pub fn drain<R>(&mut self, range: R) -> Drain<A> where
R: IndexRange<usize>,
[src]
R: IndexRange<usize>,
Create a draining iterator that removes the specified range in the vector and yields the removed items from start to end. The element range is removed even if the iterator is not consumed until the end.
Note: It is unspecified how many elements are removed from the vector,
if the Drain
value is leaked.
Panics if the starting point is greater than the end point or if the end point is greater than the length of the vector.
use arrayvec::ArrayVec; let mut v = ArrayVec::from([1, 2, 3]); let u: Vec<_> = v.drain(0..2).collect(); assert_eq!(&v[..], &[3]); assert_eq!(&u[..], &[1, 2]);
pub fn as_slice(&self) -> &[<A as Array>::Item]
[src]
Return a slice containing all elements of the vector.
pub fn as_mut_slice(&mut self) -> &mut [<A as Array>::Item]
[src]
Return a mutable slice containing all elements of the vector.
Trait Implementations
impl Clone for EnhancedSpectrals
[src]
fn clone(&self) -> EnhancedSpectrals
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Deref for EnhancedSpectrals
[src]
type Target = ArrayVec<[f32; 56]>
The resulting type after dereferencing.
fn deref(&self) -> &Self::Target
[src]
Dereferences the value.
impl DerefMut for EnhancedSpectrals
[src]
impl Default for EnhancedSpectrals
[src]
fn default() -> EnhancedSpectrals
[src]
Create a new EnhancedSpectrals
with default initial values.