Trait good_lp::solvers::Solution[][src]

pub trait Solution {
    fn value(&self, variable: Variable) -> f64;

    fn eval(&self, expr: &Expression) -> f64
    where
        Self: Sized
, { ... } }

A problem solution

Required methods

fn value(&self, variable: Variable) -> f64[src]

Get the optimal value of a variable of the problem

Loading content...

Provided methods

fn eval(&self, expr: &Expression) -> f64 where
    Self: Sized
[src]

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.);
Loading content...

Implementations on Foreign Types

impl<N: Into<f64> + Clone> Solution for HashMap<Variable, 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.

Loading content...

Implementors

impl Solution for CoinCbcSolution[src]

impl Solution for LpSolveSolution[src]

impl Solution for MiniLpSolution[src]

Loading content...