pub struct RealData { /* private fields */ }Implementations§
Source§impl RealData
impl RealData
pub fn new(x_data: Array1<f64>, y_data: Array2<f64>) -> Result<Self, DataError>
Sourcepub fn from_axis(x_axis: XAxis, y_data: Array2<f64>) -> Result<Self, DataError>
pub fn from_axis(x_axis: XAxis, y_data: Array2<f64>) -> Result<Self, DataError>
Create data from an existing axis. Only the length is checked, since
an XAxis is always valid.
pub fn zeros(num_channels: usize, num_data_points: usize) -> Self
pub fn from_x_data( x_data: Array1<f64>, num_channels: usize, ) -> Result<Self, DataError>
pub fn from_y_data(y_data: Array2<f64>) -> Self
pub fn comment(&self) -> Option<&str>
pub fn set_comment(&mut self, comment: Option<&str>)
pub fn channel_label(&self, channel: usize) -> Option<&str>
pub fn set_channel_label(&mut self, channel: usize, label: Option<&str>)
pub fn num_channels(&self) -> usize
pub fn num_data_points(&self) -> usize
Sourcepub fn x_axis(&self) -> &XAxis
pub fn x_axis(&self) -> &XAxis
The x axis. Prefer this over x_data for single
values (XAxis::get) or iteration, because it never allocates.
Sourcepub fn x_data(&self) -> CowArray<'_, f64, Ix1>
pub fn x_data(&self) -> CowArray<'_, f64, Ix1>
The x values as an array. Borrowed for an explicit axis, computed (one allocation) for a uniform one.
Sourcepub fn set_x_axis(&mut self, x_axis: XAxis) -> Result<(), DataError>
pub fn set_x_axis(&mut self, x_axis: XAxis) -> Result<(), DataError>
Replace the x axis. It must have one value per data point.
pub fn y_data(&self) -> ArrayView2<'_, f64>
pub fn y_data_mut(&mut self) -> ArrayViewMut2<'_, f64>
Sourcepub fn into_y_data(self) -> Array2<f64>
pub fn into_y_data(self) -> Array2<f64>
Consume the data and return the owned y values without copying.
pub fn channel(&self, ch: usize) -> ArrayView1<'_, f64>
pub fn channel_mut(&mut self, ch: usize) -> ArrayViewMut1<'_, f64>
pub fn channel_iter(&self) -> AxisIter<'_, f64, Ix1> ⓘ
pub fn channel_iter_mut(&mut self) -> AxisIterMut<'_, f64, Ix1> ⓘ
pub fn iter(&self) -> Iter<'_, f64, Ix2> ⓘ
pub fn iter_mut(&mut self) -> IterMut<'_, f64, Ix2> ⓘ
Source§impl RealData
impl RealData
pub fn max_per_channel(&self) -> Vec<(f64, f64)>
pub fn max_overall(&self) -> (f64, f64)
pub fn max_abs_per_channel(&self) -> Vec<(f64, f64)>
pub fn max_abs_overall(&self) -> (f64, f64)
pub fn min_max_per_channel(&self) -> Vec<((f64, f64), (f64, f64))>
pub fn min_max_overall(&self) -> ((f64, f64), (f64, f64))
pub fn to_decibels(&self) -> RealData
pub fn to_gain(&self) -> RealData
Trait Implementations§
Source§impl AbsDiffEq for RealData
impl AbsDiffEq for RealData
Source§fn default_epsilon() -> Self::Epsilon
fn default_epsilon() -> Self::Epsilon
The default tolerance to use when testing values that are close together. Read more
Source§fn abs_diff_eq(&self, other: &Self, epsilon: Self::Epsilon) -> bool
fn abs_diff_eq(&self, other: &Self, epsilon: Self::Epsilon) -> bool
A test for equality that uses the absolute difference to compute the approximate
equality of two numbers.
Source§fn abs_diff_ne(&self, other: &Rhs, epsilon: Self::Epsilon) -> bool
fn abs_diff_ne(&self, other: &Rhs, epsilon: Self::Epsilon) -> bool
The inverse of
AbsDiffEq::abs_diff_eq.Source§impl<'de> Deserialize<'de> for RealData
impl<'de> Deserialize<'de> for RealData
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<'a> IntoIterator for &'a RealData
impl<'a> IntoIterator for &'a RealData
Source§impl<'a> IntoIterator for &'a mut RealData
impl<'a> IntoIterator for &'a mut RealData
Source§impl IntoIterator for RealData
impl IntoIterator for RealData
Auto Trait Implementations§
impl Freeze for RealData
impl RefUnwindSafe for RealData
impl Send for RealData
impl Sync for RealData
impl Unpin for RealData
impl UnsafeUnpin for RealData
impl UnwindSafe for RealData
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more