From 82f6e5248d414c43698aad8370ebaa9d14830e69 Mon Sep 17 00:00:00 2001 From: "Jip J. Dekker" Date: Mon, 13 May 2024 16:05:53 +1000 Subject: [PATCH] Stronger GreaterEq literal rounding --- crates/huub/src/solver/view.rs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/crates/huub/src/solver/view.rs b/crates/huub/src/solver/view.rs index 33899b81..44a2d7ed 100644 --- a/crates/huub/src/solver/view.rs +++ b/crates/huub/src/solver/view.rs @@ -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, ))), @@ -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 {