pub struct Constraint {
pub id: ConstraintId,
pub coeffs: FxHashMap<VarId, BigRational>,
pub sense: ConstraintSense,
pub rhs: BigRational,
pub name: Option<String>,
}Expand description
A constraint in the LP/MIP
Fields§
§id: ConstraintIdConstraint ID
coeffs: FxHashMap<VarId, BigRational>Linear coefficients
sense: ConstraintSenseConstraint sense
rhs: BigRationalRight-hand side
name: Option<String>Name (optional)
Implementations§
Source§impl Constraint
impl Constraint
Sourcepub fn new(id: ConstraintId, sense: ConstraintSense, rhs: BigRational) -> Self
pub fn new(id: ConstraintId, sense: ConstraintSense, rhs: BigRational) -> Self
Create a new constraint
Sourcepub fn add_coeff(self, var: VarId, coeff: BigRational) -> Self
pub fn add_coeff(self, var: VarId, coeff: BigRational) -> Self
Add a coefficient
Trait Implementations§
Source§impl Clone for Constraint
impl Clone for Constraint
Source§fn clone(&self) -> Constraint
fn clone(&self) -> Constraint
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for Constraint
impl RefUnwindSafe for Constraint
impl Send for Constraint
impl Sync for Constraint
impl Unpin for Constraint
impl UnsafeUnpin for Constraint
impl UnwindSafe for Constraint
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