Trait good_lp::Solution[][src]

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

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

A problem solution

Required methods

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

Get the optimal value of a variable of the problem

Loading content...

Provided methods

fn eval(&self, expr: &Expression<F>) -> 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<F, N: Into<f64> + Clone> Solution<F> for HashMap<Variable<F>, N>[src]

Loading content...

Implementors

Loading content...