-
-
Notifications
You must be signed in to change notification settings - Fork 47
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
[FR] Expose variadic signatures for integrate_1d
(deprecate current?)
#1352
Comments
If I'm reading the signature correctly there shouldn't be a need to deprecate the existing signature since it can just be treated as a 'variadic' signature with those 3 arguments as the 'user chosen' arguments. We do need to actually expose that function in the math library (I don't want stanc generating code that calls an |
An issue is going to be that the |
Ah, yeah. That will be similar to the changes @charlesm93 and I made to the algebra solvers, which required two signatures |
I think you can tell by comparing to the integrand function's signature. The integrand does not take |
I agree that is possible, I don't think it's preferable in the actual implementation however (It would need a decent deal of special-casing, not to mention I can imagine it leading to weird error messages and/or subtle bugs if someone actually wanted a final argument they forgot to add to the function) |
@WardBrian So the variadic signatures would be: real integrate_1d (function integrand, real a, real b, ...)
real integrate_1d_tol (function integrand, real a, real b, ..., real relative_tolerance) Do those look ok? Another little issue is that |
An alternative would be for the real integrate_1d_tol (function integrand, real a, real b, real relative_tolerance, ...) This is consistent with the variadic ODE functions but inconsistent with the previous |
I think for an initial implementation it’s better to match previous functions in terms of both tolerance and pstream. Then adding this would be essentially free, we can just add it to the variadic table we already have. (I think we still need a new name though). That being said, it would be nice to stop the pstream special casing eventually. Ideally we would update the C++ for every variadic function at once and then we can just rip all of that out of the compiler |
Note: when introducing a new name, may be useful to include the algorithm in it, in anticipation of things like stan-dev/math#3000 |
The
integrate_1d
implementation in the Math library supports variadic unstructured arguments, but the Stan language only exposes thetheta, x_r, x_i
parameterisation like the deprecated ODE signatures: https://mc-stan.org/docs/functions-reference/functions-1d-integrator.html#call-to-the-1d-integratorI think this should be deprecated and changed to the variadic signatures for consistency with the ODE functions
The text was updated successfully, but these errors were encountered: