pub struct KeysWithOffset<T> {
offset: usize,
keys: Vec<T>,
}Expand description
Corresponding variables for a constraint along with the row offset in the solution
Fields§
§offset: usizeRow offset in the solver’s row ordering corresponding to the first key in keys.
This offset is used to index into the solver duals vector when mapping dual
values back to the stored keys.
keys: Vec<T>Keys for each constraint row. The number of keys equals the number of rows
covered starting at offset.
Implementations§
Source§impl<T> KeysWithOffset<T>
impl<T> KeysWithOffset<T>
Sourcepub fn zip_duals<'a, U>(
&'a self,
duals: &'a [f64],
) -> impl Iterator<Item = (&'a T, U)>where
U: UnitType,
pub fn zip_duals<'a, U>(
&'a self,
duals: &'a [f64],
) -> impl Iterator<Item = (&'a T, U)>where
U: UnitType,
Zip the keys with the corresponding dual values in the solution, accounting for the offset.
The returned iterator yields pairs of (key, dual) where dual is wrapped in the
unit type U: UnitType. The method asserts that the provided duals slice contains
at least offset + keys.len() elements.
Auto Trait Implementations§
impl<T> Freeze for KeysWithOffset<T>
impl<T> RefUnwindSafe for KeysWithOffset<T>where
T: RefUnwindSafe,
impl<T> Send for KeysWithOffset<T>where
T: Send,
impl<T> Sync for KeysWithOffset<T>where
T: Sync,
impl<T> Unpin for KeysWithOffset<T>where
T: Unpin,
impl<T> UnwindSafe for KeysWithOffset<T>where
T: UnwindSafe,
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> 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