kaskr / adcomp

AD computation with Template Model Builder (TMB)
Other
176 stars 80 forks source link

simplify `asDouble` and avoid the need for `WITH_LIBTMB` with by using #311

Open boennecd opened 4 years ago

boennecd commented 4 years ago

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); 
}
kaskr commented 4 years ago

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...