Skip to main content

RegimeEnvelope

Struct RegimeEnvelope 

Source
pub struct RegimeEnvelope { /* private fields */ }
Expand description

Regime-sensitive admissibility envelope with dynamic radius tracking.

Wraps AdmissibilityEnvelope and adds:

  1. Mode-dependent radius updates (widening / tightening EMA)
  2. Regime switching (snap between ρ_base and ρ_max)
  3. Grammar trust scalar computation
  4. Aggregate-mode maximum over multiple constraints

§Stack footprint: ~48 bytes (all f32 + enum tags)

Implementations§

Source§

impl RegimeEnvelope

Source

pub const fn new(params: RegimeEnvelopeParams) -> Self

Construct with given parameters, starting in Fixed mode at ρ_base.

Source

pub fn from_envelope(env: &AdmissibilityEnvelope) -> Self

Construct directly from a base AdmissibilityEnvelope.

Source

pub fn set_mode(&mut self, mode: EnvelopeMode)

Set a different operating mode.

Source

pub fn rho_eff(&self) -> f32

Current effective envelope radius ρ_eff.

Source

pub fn mode(&self) -> EnvelopeMode

Current mode.

Source

pub fn update( &mut self, norm: f32, regime: RfRegime, other_rho: &[f32], ) -> EnvelopeUpdateResult

Update the envelope for one observation of residual norm.

Adjusts ρ_eff according to the current mode, then computes and returns the grammar trust scalar.

other_rho is only used in Aggregate mode (max over all provided values); pass an empty slice for other modes.

Source

pub fn update_with_slew( &mut self, norm: f32, regime: RfRegime, other_rho: &[f32], delta_norm: f32, ) -> (EnvelopeUpdateResult, bool)

Update with explicit delta_norm for slew detection.

Returns (EnvelopeUpdateResult, abrupt_slew).

Source

pub fn reset(&mut self)

Reset to initial state (Fixed mode, ρ_base).

Auto Trait Implementations§

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> 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.