Struct good_lp::variable::ProblemVariables [−][src]
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]
&mut self,
var_def: VariableDefinition,
len: usize
) -> Vec<Variable>
Adds a list of variables with the given definition
pub fn optimise<E: IntoAffineExpression>(
self,
direction: ObjectiveDirection,
objective: E
) -> UnsolvedProblem
[src]
self,
direction: ObjectiveDirection,
objective: E
) -> UnsolvedProblem
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]
&self
) -> impl Iterator<Item = (Variable, &VariableDefinition)>
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]
fn default() -> 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?
fn into_iter(self) -> Self::IntoIter
[src]
Auto Trait Implementations
impl RefUnwindSafe for ProblemVariables
impl Send for ProblemVariables
impl Sync for ProblemVariables
impl Unpin for ProblemVariables
impl UnwindSafe for ProblemVariables
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,