pub struct Constraint {
pub coefficients: Vec<BigRational>,
pub rhs: BigRational,
pub kind: ConstraintKind,
}Expand description
A linear constraint a'x {≤|≥|=} b.
Fields§
§coefficients: Vec<BigRational>Coefficients for each decision variable (length == n_vars).
rhs: BigRationalRight-hand side.
kind: ConstraintKindSense of the constraint.
Implementations§
Source§impl Constraint
impl Constraint
Sourcepub fn le(coeffs: impl Into<Vec<BigRational>>, rhs: BigRational) -> Self
pub fn le(coeffs: impl Into<Vec<BigRational>>, rhs: BigRational) -> Self
Construct a constraint from integer coefficients (convenience).
Sourcepub fn ge(coeffs: impl Into<Vec<BigRational>>, rhs: BigRational) -> Self
pub fn ge(coeffs: impl Into<Vec<BigRational>>, rhs: BigRational) -> Self
Construct a ≥ constraint.
Sourcepub fn eq(coeffs: impl Into<Vec<BigRational>>, rhs: BigRational) -> Self
pub fn eq(coeffs: impl Into<Vec<BigRational>>, rhs: BigRational) -> Self
Construct an equality constraint.
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