pub struct OrderedRhoBounds { /* private fields */ }Expand description
A validated, finite, ordered ρ (log-λ) seed interval [lo, hi].
Every seed clamp in the outer-optimizer prepass and the candidate lattice
derives a trial ρ and pins it into a single uniform box assembled from two
independently-owned constants — the outer ρ lower wall
(options.rho_lower_bound) and an over-smoothing ceiling (RHO_BOUND or an
effective-df crossing). When those constants drift apart the interval inverts
(lo > hi): the #2370 disease, where an edf-ceiling that used to equal
-rho_lower_bound was moved by #2356 and the emitted upper bound dropped
below the lower one. The historical response — silently swapping the pair
(normalize_seed_bounds) — does not make the fit correct; it makes the
optimizer solve a different, silently substituted box and return a model as
if nothing were wrong. That is strictly worse than the panic it replaced: a
panic is loud, a silently-wrong λ-box is not.
This type makes the inverted state unrepresentable. It is constructed only
through OrderedRhoBounds::new, which refuses an inverted or non-finite
interval with the same typed [EstimationError::InvalidInput] the outer
entry (run_outer_uncertified) now enforces (#2379 / #2370). Every downstream
clamp then operates on an interval that is ordered by construction, so
f64::clamp’s min <= max precondition can never be violated.
Implementations§
Source§impl OrderedRhoBounds
impl OrderedRhoBounds
Sourcepub fn new(lo: f64, hi: f64) -> Result<Self, EstimationError>
pub fn new(lo: f64, hi: f64) -> Result<Self, EstimationError>
Validate and wrap a [lo, hi] ρ interval. Refuses (rather than silently
reorders) an inverted (lo > hi) or non-finite interval, naming both
endpoints. lo == hi is a valid degenerate single-point box.
Sourcepub fn clamp(self, value: f64) -> f64
pub fn clamp(self, value: f64) -> f64
Clamp value into [lo, hi]. Infallible: the interval is ordered by
construction, so f64::clamp’s min <= max precondition always holds.
Sourcepub fn with_upper_at_least(self, floor: f64) -> Self
pub fn with_upper_at_least(self, floor: f64) -> Self
Raise the upper endpoint to at least floor, preserving orderedness.
The criterion-ranked prepass widens its over-smoothing bound to the full
range the outer optimizer can reach (RHO_BOUND) so a genuinely large λ
seed is not clipped to the seed band. This only ever raises hi, so the
interval stays valid by construction. A non-finite floor is ignored to
preserve the finiteness invariant (callers pass the finite RHO_BOUND).
Trait Implementations§
Source§impl Clone for OrderedRhoBounds
impl Clone for OrderedRhoBounds
Source§fn clone(&self) -> OrderedRhoBounds
fn clone(&self) -> OrderedRhoBounds
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for OrderedRhoBounds
Source§impl Debug for OrderedRhoBounds
impl Debug for OrderedRhoBounds
Source§impl PartialEq for OrderedRhoBounds
impl PartialEq for OrderedRhoBounds
impl StructuralPartialEq for OrderedRhoBounds
Auto Trait Implementations§
impl Freeze for OrderedRhoBounds
impl RefUnwindSafe for OrderedRhoBounds
impl Send for OrderedRhoBounds
impl Sync for OrderedRhoBounds
impl Unpin for OrderedRhoBounds
impl UnsafeUnpin for OrderedRhoBounds
impl UnwindSafe for OrderedRhoBounds
Blanket Implementations§
impl<T> Boilerplate 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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T, U> Imply<T> for U
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>
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>
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
impl<T> Scalar for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.