-
-
Notifications
You must be signed in to change notification settings - Fork 31
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
add segbuf to quadgkjl #151
Conversation
I would think this would be best to do at |
I don't follow what you mean by
Is the idea to define @static if isdefined(QuadGK, :alloc_segbuf)
# define QuadGKJL with segbuf
else
# define current version of QuadGKJL
end |
order::Int | ||
norm::F | ||
segbuf::S |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to add the keyword to the docstring.
I think this is what is meant by init: |
Thank you for the link. I see how it would be a good idea to cache the quadrature rule, or at least allocate memory for it. It's hard to predict how general-purpose a caching interface for quadratures can be, since there are quadratures tailored to all sorts of problems, but if we set up the init interface then at least each algorithm could have a corresponding cache. It seems like I could close this pr and open a new one for properly providing the init interface as soon as I have some time for it |
Yeah I think this is probably the right direction here. In the end, we really just need the |
Sometimes
quadgk
is used in the inner loop of a larger calculation (such as a nested integral) and it is desirable to reduce the number of allocations it makes. This pr adds asegbuf
field to theQuadGKJL
algorithm to allow the user to pass in a segment buffer that reduces the amount of memory allocated by the routine when reused across calls with compatible domain, integral, and error types.