Skip to content

Commit

Permalink
Fixes regressions with Field in event detection #290
Browse files Browse the repository at this point in the history
  • Loading branch information
Serrof committed Jan 25, 2024
1 parent af704e6 commit 8b74271
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
5 changes: 5 additions & 0 deletions hipparchus-ode/src/changes/changes.xml
Expand Up @@ -49,6 +49,11 @@ If the output is not quite correct, check for invisible trailing spaces!
<title>Hipparchus ODE Release Notes</title>
</properties>
<body>
<release version="3.1" date="TBD" description="TBD.">
<action dev="serrof" type="fix" issue="issues/290">
Fixes regressions with Field in event detection.
</action>
</release>
<release version="3.0" date="2023-10-08" description="This is a major release.">
<action dev="luc" type="update" issue="issues/271" due-to="Romain Serra">
Removed unused mapper in initializeStep.
Expand Down
Expand Up @@ -366,7 +366,7 @@ private boolean findRoot(final FieldODEStateInterpolator<T> interpolator,
// executed once if we didn't hit a special case above
while ((afterRootG.isZero() || afterRootG.getReal() > 0.0 == g0Positive) &&
strictlyAfter(afterRootT, tb)) {
if (loopG.isZero()) {
if (loopG.getReal() == 0.0) {
// ga == 0.0 and gb may or may not be 0.0
// handle the root at ta first
beforeRootT = loopT;
Expand Down Expand Up @@ -424,7 +424,7 @@ private boolean findRoot(final FieldODEStateInterpolator<T> interpolator,
}

// figure out the result of root finding, and return accordingly
if (afterRootG.isZero() || afterRootG.getReal() > 0.0 == g0Positive) {
if (afterRootG.getReal() == 0.0 || afterRootG.getReal() > 0.0 == g0Positive) {
// loop gave up and didn't find any crossing within this step
return false;
} else {
Expand Down
3 changes: 3 additions & 0 deletions src/changes/changes.xml
Expand Up @@ -50,6 +50,9 @@ If the output is not quite correct, check for invisible trailing spaces!
</properties>
<body>
<release version="3.1" date="TBD" description="TBD.">
<action dev="serrof" type="fix" issue="issues/290">
Fixes regressions with Field in event detection.
</action>
<action dev="luc" type="add" due-to="Francesco Rocca" issue="issues/296">
Added constrained optimization.
</action>
Expand Down

0 comments on commit 8b74271

Please sign in to comment.