pub struct VarId(pub usize);Expand description
A unique identifier for a variable in a model.
This is used internally by the solver and the model to index variable values.
Tuple Fields§
§0: usizeImplementations§
Source§impl VarId
impl VarId
Sourcepub fn leq(self, rhs: f64) -> Constraint
pub fn leq(self, rhs: f64) -> Constraint
Creates a <= constraint: self <= rhs.
Sourcepub fn geq(self, rhs: f64) -> Constraint
pub fn geq(self, rhs: f64) -> Constraint
Creates a >= constraint: self >= rhs.
Sourcepub fn eq(self, rhs: f64) -> Constraint
pub fn eq(self, rhs: f64) -> Constraint
Creates a == constraint: self == rhs.
Trait Implementations§
Source§impl AddAssign<VarId> for LinExpr
LinExpr += VarId
impl AddAssign<VarId> for LinExpr
LinExpr += VarId
Source§fn add_assign(&mut self, rhs: VarId)
fn add_assign(&mut self, rhs: VarId)
Performs the
+= operation. Read moreSource§impl From<VarId> for LinExpr
Allows converting a single variable into a linear expression with coefficient 1.0.
impl From<VarId> for LinExpr
Allows converting a single variable into a linear expression with coefficient 1.0.
Source§impl Mul<VarId> for f64
Allows multiplying a constant by a variable to create a linear expression.
impl Mul<VarId> for f64
Allows multiplying a constant by a variable to create a linear expression.
§Examples
let mut model = Model::new();
let x = model.add_var().finish();
let expr = 3.0 * x; // LinExpr representing 3*xSource§impl Mul<f64> for VarId
Allows multiplying a variable by a constant to create a linear expression.
impl Mul<f64> for VarId
Allows multiplying a variable by a constant to create a linear expression.
§Examples
let mut model = Model::new();
let x = model.add_var().finish();
let expr = x * 3.0; // LinExpr representing 3*ximpl Copy for VarId
impl Eq for VarId
impl StructuralPartialEq for VarId
Auto Trait Implementations§
impl Freeze for VarId
impl RefUnwindSafe for VarId
impl Send for VarId
impl Sync for VarId
impl Unpin for VarId
impl UnsafeUnpin for VarId
impl UnwindSafe for VarId
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