Skip to content

Commit

Permalink
Stronger GreaterEq literal rounding
Browse files Browse the repository at this point in the history
  • Loading branch information
Dekker1 committed May 13, 2024
1 parent 6b0049d commit 82f6e52
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions crates/huub/src/solver/view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ impl LinearTransform {
None
}
}
LitMeaning::GreaterEq(i) => Some(LitMeaning::GreaterEq(div_floor(
LitMeaning::GreaterEq(i) => Some(LitMeaning::GreaterEq(div_ceil(
i - transformer.offset,
transformer.scale,
))),
Expand All @@ -323,11 +323,6 @@ fn div_ceil(a: IntVal, b: NonZeroIntVal) -> IntVal {
a / b.get() + (0 != a % b.get()) as IntVal
}

#[inline]
fn div_floor(a: IntVal, b: NonZeroIntVal) -> IntVal {
a / b.get()
}

impl Neg for LinearTransform {
type Output = Self;
fn neg(self) -> Self::Output {
Expand Down

0 comments on commit 82f6e52

Please sign in to comment.