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

Refactor infinity substitution #231

Merged
merged 7 commits into from
Feb 14, 2024
Merged

Refactor infinity substitution #231

merged 7 commits into from
Feb 14, 2024

Conversation

lxvm
Copy link
Collaborator

@lxvm lxvm commented Feb 12, 2024

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

Fixes #141
Addresses a sub-issue of #221

This pr refactors the infinity substitution and expands the test set to include checks for:

  • batch integral functions
  • inference succeeding through the infinity transformation
  • flipped limits of integration

To improve type-stability, we could always do the inf transformation by default, which could address #65. I haven't done that here since it is a major change that is most likely non-breaking, but I want to bring it up for discussion.
Additionally, I think handled units more correctly, but I don't have tests for that yet.

@ChrisRackauckas
Copy link
Member

To improve type-stability, we could always do the inf transformation by default, which could address #65. I haven't done that here since it is a major change that is most likely non-breaking, but I want to bring it up for discussion.

I think we should. It should be an optimization to do transform = Val(false) (with type information), so that things always work by default. I don't think the cost of doing a runtime branch check is high, so just having a runtime "if transform" is really way too cheap to be paying the cost of type instability.

@ChrisRackauckas ChrisRackauckas merged commit d97ff6f into SciML:master Feb 14, 2024
7 of 8 checks passed
@lxvm lxvm deleted the inftypes branch February 14, 2024 14:13
@araujoms
Copy link

I just wanted to thank you for this PR; I had a bug I was meaning to fix for a while (caused by mismatched types when using Inf boundaries), and finally got around to it today. But to my surprise the buggy piece of software mysteriously started working. I then tracked what changed, and it turned out that version 4.4.0 of Integrals is what fixed my bug, and it was released just yesterday!

@lxvm lxvm mentioned this pull request Mar 3, 2024
8 tasks
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.

Integrals with lb > ub
3 participants