adcomp
adcomp copied to clipboard
simplify `asDouble` and avoid the need for `WITH_LIBTMB` with by using
… inline
change loop order in asSEXP and asMatrix (R matrices are in column major order)
fix https://github.com/kaskr/adcomp/issues/309
Notice that there is still a value function here:
https://github.com/kaskr/adcomp/blob/52002f8dd4e022661b1f4f32986a0c40a19fbd75/TMB/inst/include/tmb_core.hpp#L803-L818
which can be changed to
template<class T>
double value(T const x)
{
return asDouble(x);
}
Thanks for the PR - your changes make sense.
In case you make other changes I would kindly ask to split in many small commits. Reason: There's a major restructure coming up (new AD framework - branch 'TMBad') and merging could become non-trivial if too much is done at once...