Trait good_lp::solvers::Solution [−][src]
A problem solution
Required methods
fn value(&self, variable: Variable<F>) -> f64
[src]
Get the optimal value of a variable of the problem
Provided methods
fn eval(&self, expr: &Expression<F>) -> f64 where
Self: Sized,
[src]
Self: Sized,
Example
use good_lp::{variables, variable, coin_cbc, SolverModel, Solution}; let mut vars = variables!(); let a = vars.add(variable().max(1)); let b = vars.add(variable().max(4)); let objective = a + b; let solution = vars.maximise(objective.clone()).using(coin_cbc).solve().unwrap(); assert_eq!(solution.eval(&objective), 5.);
Implementations on Foreign Types
impl<F, N: Into<f64> + Clone> Solution<F> for HashMap<Variable<F>, N>
[src]
All HashMap<Variable<_>, {number}>
implement Solution.
If a HashMap doesn't contain the value for a variable,
then Solution::value will panic if you try to access it.