pub struct SolutionPoint {
pub primal: FxHashMap<VarId, f64>,
pub objective: Option<f64>,
}Expand description
A single primal point returned by a solver.
Most solves yield one point, but a global solver asked to enumerate solutions
may returns several. In a SolverResult the points live in SolverResult::solutions.
Index 0 is always the best/incumbent.
Fields§
§primal: FxHashMap<VarId, f64>§objective: Option<f64>Implementations§
Source§impl SolutionPoint
impl SolutionPoint
Sourcepub fn value_of(&self, expr: Expr<'_>) -> Option<f64>
pub fn value_of(&self, expr: Expr<'_>) -> Option<f64>
Evaluate an expression at this primal point.
Returns None when any variable needed by the expression is absent.
Parameter values are read from the expression’s model arena at query
time.
Sourcepub fn value_of_idx<V, K: Into<IndexKey>>(
&self,
var: &IndexedVar<'_, V>,
key: K,
) -> Option<f64>
pub fn value_of_idx<V, K: Into<IndexKey>>( &self, var: &IndexedVar<'_, V>, key: K, ) -> Option<f64>
Look up the primal value for a specific index of an IndexedVar.
Returns None if key is not in the variable’s set or the solver did
not return a primal value for that scalar.
Sourcepub fn values_of<'iv, 'a, V>(
&'iv self,
var: &'iv IndexedVar<'a, V>,
) -> impl Iterator<Item = (&'iv IndexKey, f64)> + 'iv
pub fn values_of<'iv, 'a, V>( &'iv self, var: &'iv IndexedVar<'a, V>, ) -> impl Iterator<Item = (&'iv IndexKey, f64)> + 'iv
Iterate over primal values for all entries of an IndexedVar.
Yields (&IndexKey, f64) for every index whose primal value is present
in the solution.
Trait Implementations§
Source§impl Clone for SolutionPoint
impl Clone for SolutionPoint
Source§fn clone(&self) -> SolutionPoint
fn clone(&self) -> SolutionPoint
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SolutionPoint
impl Debug for SolutionPoint
Source§impl Default for SolutionPoint
impl Default for SolutionPoint
Source§fn default() -> SolutionPoint
fn default() -> SolutionPoint
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for SolutionPoint
impl RefUnwindSafe for SolutionPoint
impl Send for SolutionPoint
impl Sync for SolutionPoint
impl Unpin for SolutionPoint
impl UnsafeUnpin for SolutionPoint
impl UnwindSafe for SolutionPoint
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,
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