-
-
Notifications
You must be signed in to change notification settings - Fork 30
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
Passing data to function #79
Comments
So |
So, for a bit more context, this is part of a statistical package. |
One more point is that we'd like to handle the data with some abstraction so that we have a general modeling framework. Obviously, it is trivial to hard code the values when they're known ahead of time. |
You can use a closure then. |
Hello,
I have a function that I would like to integrate repeatedly but which depends on data whose values might change. Is there a way to specify a function in Quadrature.jl such that I don't need to create a new QuadratureProblem each time the values of the data change?
For example, is there a way to pass
f(x, p, d) = sum(sin.(x * p + d))
so that I could change the value ofd
in an outer loop and just callsolve()
instead of creating a new QuadratureProblem each time?Apologies in advance if this is obvious and there is something trivial I am overlooking.
Thanks,
Jon
The text was updated successfully, but these errors were encountered: