pub struct VarToFull { /* private fields */ }Expand description
The var-x → full-x map, materialized once so a loop does not re-borrow the NLP per row.
Built with VarToFull::build at the point of use, from the
NLP’s own var_x_to_full_x. Lookups are bounds-checked and return
None rather than a neighbouring row’s index — the whole point
of the exercise.
Implementations§
Source§impl VarToFull
impl VarToFull
Sourcepub fn build(n_var_x: usize, to_full: impl FnMut(VarX) -> usize) -> Self
pub fn build(n_var_x: usize, to_full: impl FnMut(VarX) -> usize) -> Self
Build the map by converting every var-x row, 0..n_var_x.
to_full is the one place a raw index is asserted to be in
full-x. In the solver it is nlp.var_x_to_full_x; keeping it to
a single call site per map is the whole protection this type
offers, so do not add a second way to mint a FullX.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for VarToFull
impl RefUnwindSafe for VarToFull
impl Send for VarToFull
impl Sync for VarToFull
impl Unpin for VarToFull
impl UnsafeUnpin for VarToFull
impl UnwindSafe for VarToFull
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,
impl<T, U> Imply<T> for U
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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