Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove complication from PresetTimeCallback #212

Merged
merged 3 commits into from
Mar 28, 2024

Conversation

oscardssmith
Copy link
Contributor

Previously this code was doing some fairly weird stuff with the closures relying on indices being passed around in spooky ways. This was (I believe) intended as an optimization, but was confusing both me and the compiler, so I deleted it, and am replacing the in calls with insorted to make it faster.

Checklist

  • Appropriate tests were added
  • Any code changes were done in a way that does not break public API
  • All documentation related to code changes were updated
  • The new code follows the
    contributor guidelines, in particular the SciML Style Guide and
    COLPRAC.
  • Any new documentation only uses public API

Additional context

Add any other context about the problem here.

Previously this code was doing some fairly weird stuff with the closures relying on indices being passed around in spooky ways. This was (I believe) intended as an optimization, but was confusing both me and the compiler, so I deleted it, and am replacing the in calls with `insorted` to make it faster.
@ChrisRackauckas
Copy link
Member

No, it's not an optimization. It's a correctness thing. We need to subset after a thing is used to prevent double using the same tstop.

@oscardssmith
Copy link
Contributor Author

added a check to the condition to make this only fire when the last dt brought us to a new t value.

@ChrisRackauckas ChrisRackauckas merged commit 9d65bb5 into SciML:master Mar 28, 2024
8 of 10 checks passed
@oscardssmith oscardssmith deleted the patch-1 branch March 28, 2024 18:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants