pub struct LinearExpr { /* private fields */ }
Expand description
A sum of variables multiplied by constant coefficients used as a left-hand side when defining constraints.
Implementations§
Source§impl LinearExpr
impl LinearExpr
Sourcepub fn add(&mut self, var: Variable, coeff: f64)
pub fn add(&mut self, var: Variable, coeff: f64)
Add a single term to the linear expression.
Variables can be added to an expression in any order, but adding the same variable
several times is forbidden (the Problem::add_constraint
method will panic).
Trait Implementations§
Source§impl Clone for LinearExpr
impl Clone for LinearExpr
Source§fn clone(&self) -> LinearExpr
fn clone(&self) -> LinearExpr
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for LinearExpr
impl Debug for LinearExpr
Source§impl Extend<(Variable, f64)> for LinearExpr
impl Extend<(Variable, f64)> for LinearExpr
Source§fn extend<I: IntoIterator<Item = (Variable, f64)>>(&mut self, iter: I)
fn extend<I: IntoIterator<Item = (Variable, f64)>>(&mut self, iter: I)
Extends a collection with the contents of an iterator. Read more
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one
)Extends a collection with exactly one element.
Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
Source§impl<I: IntoIterator<Item = impl Into<LinearTerm>>> From<I> for LinearExpr
impl<I: IntoIterator<Item = impl Into<LinearTerm>>> From<I> for LinearExpr
Source§impl FromIterator<(Variable, f64)> for LinearExpr
impl FromIterator<(Variable, f64)> for LinearExpr
Auto Trait Implementations§
impl Freeze for LinearExpr
impl RefUnwindSafe for LinearExpr
impl Send for LinearExpr
impl Sync for LinearExpr
impl Unpin for LinearExpr
impl UnwindSafe for LinearExpr
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