stan-dev / stanc3

The Stan transpiler (from Stan to C++ and beyond).
BSD 3-Clause "New" or "Revised" License
140 stars 44 forks source link

Mark dae time parameters as DataOnly #1271

Closed WardBrian closed 1 year ago

WardBrian commented 1 year ago

Marked the initial_time and times parameters of the dae functions as DataOnly. If you look in the C++, they're doubles: https://github.com/stan-dev/math/blob/f4c68170c1f1e9bc1284520560204ea9e76c62cd/stan/math/rev/functor/dae.hpp#L167-L168

This causes a C++ compilation error which we should be catching in stanc, see https://discourse.mc-stan.org/t/compilation-error-on-using-the-differential-algebraic-equation-dae-solver-on-time-that-depends-on-the-parameters/29404

I'm going to ping @yizhang-yiz on this as the original author to confirm this is correct.

@rok-cesnovar IMO we can merge this during the freeze, but it doesn't warrant an RC2 all on its own.

Submission Checklist

Release notes

Marked the initial_time and times parameters of the dae functions as data.

Copyright and Licensing

By submitting this pull request, the copyright holder is agreeing to license the submitted work under the BSD 3-clause license (https://opensource.org/licenses/BSD-3-Clause)

WardBrian commented 1 year ago

@yizhang-yiz confirmed on the forum thread that this is the intended behavior