pub struct Variable {
pub id: VarId,
pub var_type: VarType,
pub lower: Option<BigRational>,
pub upper: Option<BigRational>,
pub obj_coeff: BigRational,
pub name: Option<String>,
}Expand description
A variable in the LP/MIP
Fields§
§id: VarIdVariable ID
var_type: VarTypeVariable type
lower: Option<BigRational>Lower bound
upper: Option<BigRational>Upper bound
obj_coeff: BigRationalObjective coefficient
name: Option<String>Name (optional)
Implementations§
Source§impl Variable
impl Variable
Sourcepub fn continuous(id: VarId) -> Self
pub fn continuous(id: VarId) -> Self
Create a new continuous variable
Sourcepub fn with_bounds(
self,
lower: Option<BigRational>,
upper: Option<BigRational>,
) -> Self
pub fn with_bounds( self, lower: Option<BigRational>, upper: Option<BigRational>, ) -> Self
Set bounds
Sourcepub fn with_obj(self, coeff: BigRational) -> Self
pub fn with_obj(self, coeff: BigRational) -> Self
Set objective coefficient
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Variable
impl RefUnwindSafe for Variable
impl Send for Variable
impl Sync for Variable
impl Unpin for Variable
impl UnsafeUnpin for Variable
impl UnwindSafe for Variable
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