Skip to main content

Gate

Struct Gate 

Source
pub struct Gate<const DOF: usize>(/* private fields */);
Expand description

Innovation gate threshold γ of equation (37), for an observation of DOF dimensions.

The degrees of freedom are a property of the observation rather than a choice, so they are part of the type: a threshold for a one-dimensional observation cannot be written into a three-dimensional source’s field, and Gate::at exists only for the dimensions this crate observes. The only free parameter left is the Percentile.

Implementations§

Source§

impl<const DOF: usize> Gate<DOF>

Source

pub const fn new(threshold: f32) -> Option<Self>

A threshold given as a number, for a caller with a reason to leave the Percentile table; None unless it is finite and strictly positive.

Each refusal is a gate that fails silently. NaN compares false against every ε and accepts everything; +∞ does the same while reporting a test ratio of zero; zero or less rejects everything, and zero makes the ratio of (38) a division by zero.

Source

pub const fn threshold(self) -> f32

The threshold γ, which a test ratio of 1 corresponds to.

Source§

impl Gate<1>

Source

pub const fn at(percentile: Percentile) -> Self

The chi-square quantile at percentile for one degree of freedom: barometric altitude, GNSS height, magnetic heading.

Checked in this module’s tests against the closed-form CDF, not against another table.

Source§

impl Gate<2>

Source

pub const fn at(percentile: Percentile) -> Self

The chi-square quantile at percentile for two degrees of freedom: the horizontal half of a GNSS position fix.

−2 ln(1 − p) exactly, since two degrees of freedom is the one case with a closed-form CDF, F(x) = 1 − e^(−x/2); checked against it in this module’s tests.

Source§

impl Gate<3>

Source

pub const fn at(percentile: Percentile) -> Self

The chi-square quantile at percentile for three degrees of freedom: GNSS velocity.

Checked in this module’s tests against the closed-form CDF, not against another table.

Trait Implementations§

Source§

impl<const DOF: usize> Clone for Gate<DOF>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<const DOF: usize> Copy for Gate<DOF>

Source§

impl<const DOF: usize> Debug for Gate<DOF>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<const DOF: usize> PartialEq for Gate<DOF>

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl<const DOF: usize> StructuralPartialEq for Gate<DOF>

Auto Trait Implementations§

§

impl<const DOF: usize> Freeze for Gate<DOF>

§

impl<const DOF: usize> RefUnwindSafe for Gate<DOF>

§

impl<const DOF: usize> Send for Gate<DOF>

§

impl<const DOF: usize> Sync for Gate<DOF>

§

impl<const DOF: usize> Unpin for Gate<DOF>

§

impl<const DOF: usize> UnsafeUnpin for Gate<DOF>

§

impl<const DOF: usize> UnwindSafe for Gate<DOF>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> Scalar for T
where T: 'static + Clone + PartialEq + Debug,

Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.