(&self)
| 396 | } |
| 397 | |
| 398 | pub fn negate(&self) -> Self { |
| 399 | if self.is_tautology() { |
| 400 | Self::new_false() |
| 401 | } else if self.is_contradiction() { |
| 402 | Self::new_true() |
| 403 | } else { |
| 404 | match self { |
| 405 | LinearConstraint::Equality(expr) => Self::Inequality(expr.clone()), |
| 406 | LinearConstraint::Inequality(expr) => Self::Equality(expr.clone()), |
| 407 | LinearConstraint::LessEq(expr) => Self::LessThan(-expr.clone()), |
| 408 | LinearConstraint::LessThan(expr) => Self::LessEq(-expr.clone()), |
| 409 | } |
| 410 | } |
| 411 | } |
| 412 | } |
| 413 | |
| 414 | impl From<LinearConstraint> for LinearConstraintSystem { |
no test coverage detected