pub struct LagMap { /* private fields */ }Expand description
Lag-alignment cache for a regular series of length series_len.
For max_lag = τ_max under ReferencePointPolicy::SeriesOrigin, effective
samples are times t = τ_max .. series_len-1 (n = series_len - τ_max).
Sample i at lag τ reads raw row base_t + i - τ.
Implementations§
Source§impl LagMap
impl LagMap
Sourcepub fn new(series_len: usize, max_lag: u32) -> Result<Self, DataError>
pub fn new(series_len: usize, max_lag: u32) -> Result<Self, DataError>
Build a lag map with the default series-origin reference policy.
§Errors
Empty series, or max_lag >= series_len.
Sourcepub fn with_reference(
series_len: usize,
max_lag: u32,
reference: ReferencePointPolicy,
) -> Result<Self, DataError>
pub fn with_reference( series_len: usize, max_lag: u32, reference: ReferencePointPolicy, ) -> Result<Self, DataError>
Build a lag map under an explicit reference-point policy.
§Errors
Empty series, invalid lag, or origin out of range.
Sourcepub const fn series_len(&self) -> usize
pub const fn series_len(&self) -> usize
Series length.
Sourcepub const fn n_effective(&self) -> usize
pub const fn n_effective(&self) -> usize
Number of aligned samples.
Sourcepub const fn reference(&self) -> ReferencePointPolicy
pub const fn reference(&self) -> ReferencePointPolicy
Reference-point policy used to build this map.
Trait Implementations§
impl Eq for LagMap
impl StructuralPartialEq for LagMap
Auto Trait Implementations§
impl Freeze for LagMap
impl RefUnwindSafe for LagMap
impl Send for LagMap
impl Sync for LagMap
impl Unpin for LagMap
impl UnsafeUnpin for LagMap
impl UnwindSafe for LagMap
Blanket Implementations§
impl<T> Allocation for T
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