pub struct Problem<EXPR = StrExpression, VAR = Variable> {
pub name: String,
pub sense: LpObjective,
pub objective: EXPR,
pub variables: Vec<VAR>,
pub constraints: Vec<Constraint<EXPR>>,
}Expand description
A concrete linear problem
Fields§
§name: Stringproblem name. “lp_solvers_problem” by default Write the problem in the lp file format to the given formatter
sense: LpObjectiveWhether to maximize or minimize the objective
objective: EXPRTarget objective function
variables: Vec<VAR>Variables of the problem
constraints: Vec<Constraint<EXPR>>List of constraints to apply
Trait Implementations§
Source§impl<'a, EXPR: 'a, VAR: 'a> LpProblem<'a> for Problem<EXPR, VAR>
impl<'a, EXPR: 'a, VAR: 'a> LpProblem<'a> for Problem<EXPR, VAR>
Source§type Expression = &'a EXPR
type Expression = &'a EXPR
expression type
Source§type ConstraintIterator = Box<dyn Iterator<Item = Constraint<&'a EXPR>> + 'a>
type ConstraintIterator = Box<dyn Iterator<Item = Constraint<&'a EXPR>> + 'a>
Iterator over constraints
Source§type VariableIterator = Iter<'a, VAR>
type VariableIterator = Iter<'a, VAR>
Iterator over variables
Source§fn variables(&'a self) -> Self::VariableIterator
fn variables(&'a self) -> Self::VariableIterator
Variables of the problem
Source§fn objective(&'a self) -> Self::Expression
fn objective(&'a self) -> Self::Expression
Target objective function
Source§fn sense(&self) -> LpObjective
fn sense(&self) -> LpObjective
Whether to maximize or minimize the objective
Source§fn constraints(&'a self) -> Self::ConstraintIterator
fn constraints(&'a self) -> Self::ConstraintIterator
List of constraints to apply
Source§fn to_lp_file_format(&'a self, f: &mut Formatter<'_>) -> Result
fn to_lp_file_format(&'a self, f: &mut Formatter<'_>) -> Result
Write the problem in the lp file format to the given formatter
Source§fn display_lp(&'a self) -> DisplayedLp<'_, Self>where
Self: Sized,
fn display_lp(&'a self) -> DisplayedLp<'_, Self>where
Self: Sized,
Return an object whose fmt::Display implementation is the problem in the .lp format
Source§fn to_tmp_file(&'a self) -> Result<NamedTempFile>where
Self: Sized,
fn to_tmp_file(&'a self) -> Result<NamedTempFile>where
Self: Sized,
Write the problem to a temporary file
Auto Trait Implementations§
impl<EXPR, VAR> Freeze for Problem<EXPR, VAR>where
EXPR: Freeze,
impl<EXPR, VAR> RefUnwindSafe for Problem<EXPR, VAR>where
EXPR: RefUnwindSafe,
VAR: RefUnwindSafe,
impl<EXPR, VAR> Send for Problem<EXPR, VAR>
impl<EXPR, VAR> Sync for Problem<EXPR, VAR>
impl<EXPR, VAR> Unpin for Problem<EXPR, VAR>
impl<EXPR, VAR> UnwindSafe for Problem<EXPR, VAR>where
EXPR: UnwindSafe,
VAR: UnwindSafe,
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