Struct good_lp::variable::ProblemVariables[][src]

pub struct ProblemVariables { /* fields omitted */ }

Represents the variables for a given problem. Each problem has a unique type, which prevents using the variables from one problem inside an other one. Instances of this type should be created exclusively using the variables! macro.

Implementations

impl ProblemVariables[src]

pub fn new() -> Self[src]

Create an empty list of variables

pub fn add_variable(&mut self) -> Variable[src]

Add a anonymous unbounded continuous variable to the problem

pub fn add(&mut self, var_def: VariableDefinition) -> Variable[src]

Add a variable with the given definition

pub fn add_vector(
    &mut self,
    var_def: VariableDefinition,
    len: usize
) -> Vec<Variable>
[src]

Adds a list of variables with the given definition

pub fn optimise<E: IntoAffineExpression>(
    self,
    direction: ObjectiveDirection,
    objective: E
) -> UnsolvedProblem
[src]

Creates an optimization problem with the given objective. Don’t solve it immediately

pub fn maximise<E: IntoAffineExpression>(self, objective: E) -> UnsolvedProblem[src]

Creates an maximization problem with the given objective. Don’t solve it immediately

pub fn minimise<E: IntoAffineExpression>(self, objective: E) -> UnsolvedProblem[src]

Creates an minimization problem with the given objective. Don’t solve it immediately

pub fn iter_variables_with_def(
    &self
) -> impl Iterator<Item = (Variable, &VariableDefinition)>
[src]

Iterates over the couples of variables with their properties

pub fn len(&self) -> usize[src]

The number of variables

pub fn is_empty(&self) -> bool[src]

Returns true when no variables have been added

Trait Implementations

impl Default for ProblemVariables[src]

impl IntoIterator for ProblemVariables[src]

type Item = VariableDefinition

The type of the elements being iterated over.

type IntoIter = IntoIter<VariableDefinition>

Which kind of iterator are we turning this into?

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.