pub struct Constraint {
pub expr: LinearExpr,
pub strict: bool,
}Expand description
A linear constraint representing either expr <= 0 or expr < 0.
All inequalities are normalized to this form during processing.
For example, x >= 5 becomes -x + 5 <= 0, i.e., 5 - x <= 0.
Fields§
§expr: LinearExprThe linear expression (constraint is expr OP 0).
strict: boolIf true, this is a strict inequality (< 0).
If false, this is a non-strict inequality (<= 0).
Implementations§
Source§impl Constraint
impl Constraint
Sourcepub fn is_satisfied_constant(&self) -> bool
pub fn is_satisfied_constant(&self) -> bool
Check if a constant constraint is satisfied For non-constant constraints, returns true (we can’t tell yet)
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 · 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 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