pub struct Coef {
pub m: Rational,
pub c: Rational,
}Expand description
A number of the form m·M + c, where M is the symbolic “big M” penalty.
Ordering is lexicographic (M dominates), which is exactly what the Big-M method needs
without picking a numeric value for M. With m == 0 it is an ordinary rational.
With the serde feature it is {"m": "7", "c": "-4"} for 7M - 4.
Fields§
§m: RationalCoefficient of M.
c: RationalConstant part.
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Coef
impl<'de> Deserialize<'de> for Coef
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Coef
Source§impl Ord for Coef
impl Ord for Coef
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialOrd for Coef
impl PartialOrd for Coef
impl StructuralPartialEq for Coef
Auto Trait Implementations§
impl Freeze for Coef
impl RefUnwindSafe for Coef
impl Send for Coef
impl Sync for Coef
impl Unpin for Coef
impl UnsafeUnpin for Coef
impl UnwindSafe for Coef
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