From 19e30d7b0f1976e8ad31e35b2bfa86418423a010 Mon Sep 17 00:00:00 2001 From: David Legg Date: Tue, 18 Jun 2024 17:47:06 -0700 Subject: [PATCH] Bug fix for clampedIntegrate There was a sign error in the definition of the overflow and underflow slack variables for clampedIntegrate. This caused the meaning of "overflow" and "underflow" to be reversed. --- .../streamline/modeling/polynomial/PolynomialResources.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/src/main/java/gov/nasa/jpl/aerie/contrib/streamline/modeling/polynomial/PolynomialResources.java b/contrib/src/main/java/gov/nasa/jpl/aerie/contrib/streamline/modeling/polynomial/PolynomialResources.java index 8eec1bfebe..67aa0c7032 100644 --- a/contrib/src/main/java/gov/nasa/jpl/aerie/contrib/streamline/modeling/polynomial/PolynomialResources.java +++ b/contrib/src/main/java/gov/nasa/jpl/aerie/contrib/streamline/modeling/polynomial/PolynomialResources.java @@ -374,7 +374,7 @@ public static ClampedIntegrateResult clampedIntegrate( // Set up slack variables for under-/overflow rateSolver.declare(lx(overflowRate), GreaterThanOrEquals, lx(0)); rateSolver.declare(lx(underflowRate), GreaterThanOrEquals, lx(0)); - rateSolver.declare(lx(rate).add(lx(underflowRate)).subtract(lx(overflowRate)), Equals, lx(integrand)); + rateSolver.declare(lx(rate).subtract(lx(underflowRate)).add(lx(overflowRate)), Equals, lx(integrand)); // Set up rate clamping conditions var integrandUB = choose(