pub struct SimpleFeature<X, Y> {
pub label: f64,
/* private fields */
}Expand description
A feature-like type that doesn’t have a variable first dimension, instead using a constant value
Fields§
§label: f64A constant value for the first dimension
Implementations§
Source§impl<X, Y> SimpleFeature<X, Y>
impl<X, Y> SimpleFeature<X, Y>
pub fn new(label: f64, y: Vec<f64>, z: Vec<f32>) -> Self
pub fn as_view(&self) -> SimpleFeatureView<'_, X, Y>
pub fn into_inner(self) -> (f64, Vec<f64>, Vec<f32>)
Sourcepub fn empty(label: f64) -> Self
pub fn empty(label: f64) -> Self
Create an empty SimpleFeature
Sourcepub fn with_capacity(capacity: usize, label: f64) -> Self
pub fn with_capacity(capacity: usize, label: f64) -> Self
Createa a new empty SimpleFeature with pre-allocated capacity
Sourcepub fn push<T: CoordinateLike<X> + IntensityMeasurement>(
&mut self,
pt: &T,
time: f64,
)
pub fn push<T: CoordinateLike<X> + IntensityMeasurement>( &mut self, pt: &T, time: f64, )
Push a new data point onto the feature and ensure the time ordering invariant is satisfied.
Trait Implementations§
Source§impl<X: Clone, Y: Clone> Clone for SimpleFeature<X, Y>
impl<X: Clone, Y: Clone> Clone for SimpleFeature<X, Y>
Source§fn clone(&self) -> SimpleFeature<X, Y>
fn clone(&self) -> SimpleFeature<X, Y>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<X, Y> CoordinateLike<X> for SimpleFeature<X, Y>
impl<X, Y> CoordinateLike<X> for SimpleFeature<X, Y>
Source§fn coordinate(&self) -> f64
fn coordinate(&self) -> f64
The trait method for accessing the coordinate of the object on coordinate
system
TSource§impl<X: Default, Y: Default> Default for SimpleFeature<X, Y>
impl<X: Default, Y: Default> Default for SimpleFeature<X, Y>
Source§fn default() -> SimpleFeature<X, Y>
fn default() -> SimpleFeature<X, Y>
Returns the “default value” for a type. Read more
Source§impl<X, Y, P: CoordinateLike<X> + IntensityMeasurement> Extend<(P, f64)> for SimpleFeature<X, Y>
impl<X, Y, P: CoordinateLike<X> + IntensityMeasurement> Extend<(P, f64)> for SimpleFeature<X, Y>
Source§fn extend<T: IntoIterator<Item = (P, f64)>>(&mut self, iter: T)
fn extend<T: IntoIterator<Item = (P, f64)>>(&mut self, iter: T)
Extends a collection with the contents of an iterator. Read more
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one)Extends a collection with exactly one element.
Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one)Reserves capacity in a collection for the given number of additional elements. Read more
Source§impl<X, Y> Extend<(f64, f64, f32)> for SimpleFeature<X, Y>
impl<X, Y> Extend<(f64, f64, f32)> for SimpleFeature<X, Y>
Source§fn extend<T: IntoIterator<Item = (f64, f64, f32)>>(&mut self, iter: T)
fn extend<T: IntoIterator<Item = (f64, f64, f32)>>(&mut self, iter: T)
Extends a collection with the contents of an iterator. Read more
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one)Extends a collection with exactly one element.
Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one)Reserves capacity in a collection for the given number of additional elements. Read more
Source§impl<X, Y> FeatureLike<X, Y> for SimpleFeature<X, Y>
impl<X, Y> FeatureLike<X, Y> for SimpleFeature<X, Y>
Source§fn iter(&self) -> impl Iterator<Item = (f64, f64, f32)>
fn iter(&self) -> impl Iterator<Item = (f64, f64, f32)>
Create an iterator that yields (x, y, intensity) references
Source§fn at(&self, index: usize) -> Option<(f64, f64, f32)>
fn at(&self, index: usize) -> Option<(f64, f64, f32)>
Get an immutable reference to feature data at a specified index
Source§fn at_time(&self, time: f64) -> Option<(f64, f64, f32)>
fn at_time(&self, time: f64) -> Option<(f64, f64, f32)>
Get an immutable reference to feature data at a specified time.Analogous
to combining
TimeInterval::find_time with FeatureLike::atSource§impl<X, Y> FeatureLikeMut<X, Y> for SimpleFeature<X, Y>
impl<X, Y> FeatureLikeMut<X, Y> for SimpleFeature<X, Y>
Source§fn iter_mut(&mut self) -> impl Iterator<Item = (&mut f64, &mut f64, &mut f32)>
fn iter_mut(&mut self) -> impl Iterator<Item = (&mut f64, &mut f64, &mut f32)>
Create an iterator that yields (x, y, intensity) mutable references Read more
Source§fn push<T: CoordinateLike<X> + IntensityMeasurement>(
&mut self,
pt: &T,
time: f64,
)
fn push<T: CoordinateLike<X> + IntensityMeasurement>( &mut self, pt: &T, time: f64, )
Add a new peak-like reference to the feature at a given y “time” coordinate. If the “time”
is not in sorted order, it should automatically re-sort.
Source§fn push_raw(&mut self, x: f64, y: f64, z: f32)
fn push_raw(&mut self, x: f64, y: f64, z: f32)
As
FeatureLikeMut::push, but instead add raw values instead of deriving them from
a peak-like reference.Source§fn reserve(&mut self, capacity: usize)
fn reserve(&mut self, capacity: usize)
Optimistically reserve additional space for
capacity entries in
the underlying storage. Read moreSource§fn at_mut(&mut self, index: usize) -> Option<(&mut f64, f64, &mut f32)>
fn at_mut(&mut self, index: usize) -> Option<(&mut f64, f64, &mut f32)>
Get a mutable reference to feature data at a specified index
Source§fn first_mut(&mut self) -> Option<(&mut f64, f64, &mut f32)>
fn first_mut(&mut self) -> Option<(&mut f64, f64, &mut f32)>
Get a mutable reference to feature data at the first index, if it exists
Source§fn last_mut(&mut self) -> Option<(&mut f64, f64, &mut f32)>
fn last_mut(&mut self) -> Option<(&mut f64, f64, &mut f32)>
Get a mutable reference to feature data at the last index, if it exists
Source§fn at_time_mut(&mut self, time: f64) -> Option<(&mut f64, f64, &mut f32)>
fn at_time_mut(&mut self, time: f64) -> Option<(&mut f64, f64, &mut f32)>
Get a mutable reference to feature data at a specified time. Analogous
to combining
TimeInterval::find_time with FeatureLikeMut::at_mutSource§impl<X, Y, P: CoordinateLike<X> + IntensityMeasurement> FromIterator<(P, f64)> for SimpleFeature<X, Y>
impl<X, Y, P: CoordinateLike<X> + IntensityMeasurement> FromIterator<(P, f64)> for SimpleFeature<X, Y>
Source§impl<X, Y> FromIterator<(f64, f64, f32)> for SimpleFeature<X, Y>
impl<X, Y> FromIterator<(f64, f64, f32)> for SimpleFeature<X, Y>
Source§impl<X, Y> IntensityMeasurement for SimpleFeature<X, Y>
impl<X, Y> IntensityMeasurement for SimpleFeature<X, Y>
Source§impl<X, Y> IntoIterator for SimpleFeature<X, Y>
impl<X, Y> IntoIterator for SimpleFeature<X, Y>
Source§impl<X, Y> PartialEq for SimpleFeature<X, Y>
impl<X, Y> PartialEq for SimpleFeature<X, Y>
Source§impl<X, Y> PartialOrd for SimpleFeature<X, Y>
impl<X, Y> PartialOrd for SimpleFeature<X, Y>
Source§impl<'a, X, Y> SplittableFeatureLike<'a, X, Y> for SimpleFeature<X, Y>
impl<'a, X, Y> SplittableFeatureLike<'a, X, Y> for SimpleFeature<X, Y>
Source§type ViewType = SimpleFeatureView<'a, X, Y>
type ViewType = SimpleFeatureView<'a, X, Y>
The type that will hold the split feature parts. They could be borrowed
or own a copy of their original data.
Source§fn split_at(&'a self, index: usize) -> (Self::ViewType, Self::ViewType)
fn split_at(&'a self, index: usize) -> (Self::ViewType, Self::ViewType)
Split the feature at
index, segmenting before and after it. The
position at index should be retained in the second segment.Source§fn split_at_time(&'a self, point: f64) -> (Self::ViewType, Self::ViewType)
fn split_at_time(&'a self, point: f64) -> (Self::ViewType, Self::ViewType)
Split the feature at
time. Read moreSource§fn slice<I: RangeBounds<usize> + Clone>(&'a self, bounds: I) -> Self::ViewType
fn slice<I: RangeBounds<usize> + Clone>(&'a self, bounds: I) -> Self::ViewType
Select the positions given by the range of positions in
boundsSource§fn split_mask(&'a self, mask: &[bool]) -> Vec<Self::ViewType>
fn split_mask(&'a self, mask: &[bool]) -> Vec<Self::ViewType>
Retain all positions where
mask is true, keeping contiguous positions
part of the same feature segments. Read moreSource§impl<X, Y> TimeArray<Y> for SimpleFeature<X, Y>
impl<X, Y> TimeArray<Y> for SimpleFeature<X, Y>
Source§impl<X, Y> TimeInterval<Y> for SimpleFeature<X, Y>
impl<X, Y> TimeInterval<Y> for SimpleFeature<X, Y>
Source§fn start_time(&self) -> Option<f64>
fn start_time(&self) -> Option<f64>
The earliest time point recorded
Source§fn apex_time(&self) -> Option<f64>
fn apex_time(&self) -> Option<f64>
The time point where the feature reaches its greatest intensity
Source§fn find_time(&self, time: f64) -> (Option<usize>, f64)
fn find_time(&self, time: f64) -> (Option<usize>, f64)
Find the position in the interval closest to the requested time
and the magnitude of the error
Source§fn as_range(&self) -> CoordinateRange<T>
fn as_range(&self) -> CoordinateRange<T>
Represent the
TimeInterval into a CoordinateRangeAuto Trait Implementations§
impl<X, Y> Freeze for SimpleFeature<X, Y>
impl<X, Y> RefUnwindSafe for SimpleFeature<X, Y>where
X: RefUnwindSafe,
Y: RefUnwindSafe,
impl<X, Y> Send for SimpleFeature<X, Y>
impl<X, Y> Sync for SimpleFeature<X, Y>
impl<X, Y> Unpin for SimpleFeature<X, Y>
impl<X, Y> UnwindSafe for SimpleFeature<X, Y>where
X: UnwindSafe,
Y: UnwindSafe,
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