Trait lp_solvers::lp_format::LpProblem[][src]

pub trait LpProblem<'a>: Sized {
    type Variable: AsVariable;
    type Expression: WriteToLpFileFormat;
    type ConstraintIterator: Iterator<Item = Constraint<Self::Expression>>;
    type VariableIterator: Iterator<Item = Self::Variable>;
    fn variables(&'a self) -> Self::VariableIterator;
fn objective(&'a self) -> Self::Expression;
fn sense(&'a self) -> LpObjective;
fn constraints(&'a self) -> Self::ConstraintIterator; fn name(&self) -> &str { ... }
fn to_lp_file_format(&'a self, f: &mut Formatter<'_>) -> Result { ... }
fn display_lp(&'a self) -> DisplayedLp<'_, Self>
    where
        Self: Sized
, { ... }
fn to_tmp_file(&'a self) -> Result<NamedTempFile>
    where
        Self: Sized
, { ... } }

Implemented by type that can be formatted as an lp problem

Associated Types

type Variable: AsVariable[src]

variable type

type Expression: WriteToLpFileFormat[src]

expression type

type ConstraintIterator: Iterator<Item = Constraint<Self::Expression>>[src]

Iterator over constraints

type VariableIterator: Iterator<Item = Self::Variable>[src]

Iterator over variables

Loading content...

Required methods

fn variables(&'a self) -> Self::VariableIterator[src]

Variables of the problem

fn objective(&'a self) -> Self::Expression[src]

Target objective function

fn sense(&'a self) -> LpObjective[src]

Whether to maximize or minimize the objective

fn constraints(&'a self) -> Self::ConstraintIterator[src]

List of constraints to apply

Loading content...

Provided methods

fn name(&self) -> &str[src]

problem name. “lp_solvers_problem” by default

fn to_lp_file_format(&'a self, f: &mut Formatter<'_>) -> Result[src]

Write the problem in the lp file format to the given formatter

fn display_lp(&'a self) -> DisplayedLp<'_, Self> where
    Self: Sized
[src]

Return an object whose fmt::Display implementation is the problem in the .lp format

fn to_tmp_file(&'a self) -> Result<NamedTempFile> where
    Self: Sized
[src]

Write the problem to a temporary file

Loading content...

Implementors

impl<'a, EXPR: 'a, VAR: 'a> LpProblem<'a> for Problem<EXPR, VAR> where
    &'a VAR: AsVariable,
    &'a EXPR: WriteToLpFileFormat
[src]

type Variable = &'a VAR

type Expression = &'a EXPR

type ConstraintIterator = Box<dyn Iterator<Item = Constraint<&'a EXPR>> + 'a>

type VariableIterator = Iter<'a, VAR>

Loading content...