pub struct CurveParams {
pub roll_type: RollType,
pub step_b: usize,
pub step_c: usize,
pub curve_scale: f64,
}Expand description
The parameters that define a curvature calculation.
Grouped into one struct because they travel together through every layer, and a function taking five bare numbers is easy to call wrongly.
Fields§
§roll_type: RollType§step_b: usizeHalf the rolling-mean window, minus one: the window is 2 * step_b + 1.
step_c: usizeDistance from the midpoint base to each side of the curve window.
curve_scale: f64Implementations§
Source§impl CurveParams
impl CurveParams
Sourcepub fn lead_in(&self) -> usize
pub fn lead_in(&self) -> usize
How many bases at each end of a piece receive no score.
The rolling mean consumes step_b on each side and the distance window a further
step_c, plus one for the triplet. A piece of length n therefore yields
n - 2 * lead_in() scores, the first of which belongs to the base at offset
lead_in(). This matches the reference implementation, which indexes curvature
from curvstep + stepone.
Trait Implementations§
Source§impl Clone for CurveParams
impl Clone for CurveParams
Source§fn clone(&self) -> CurveParams
fn clone(&self) -> CurveParams
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for CurveParams
Auto Trait Implementations§
impl Freeze for CurveParams
impl RefUnwindSafe for CurveParams
impl Send for CurveParams
impl Sync for CurveParams
impl Unpin for CurveParams
impl UnsafeUnpin for CurveParams
impl UnwindSafe for CurveParams
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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