Hi Ben,
As a follow up to this discussion, in the preparation of the C++ vignette, was the cyl_bessel_k function ever tested with v or z as parameters? I’ve been trying to use the modified bessel function within a transformed parameter block, and as long as the arguments are fixed, the code compiles, but once I make any one of the arguments a parameter, I start getting a string of 8 errors, starting with
/Library/Frameworks/R.framework/Versions/3.3/Resources/library/BH/include/boost/math/special_functions/trunc.hpp:65:11: error: cannot convert ‘result_type’ (aka ‘stan::math::var’) to ‘int’ without a conversion operator
return static_cast<int>(r)
;
^~~~~~~~~~~~~~~~~~~
/Library/Frameworks/R.framework/Versions/3.3/Resources/library/BH/include/boost/math/special_functions/trunc.hpp:70:11: note: in instantiation of function template specialization ‘boost::math::itrunc<
stan::math::var, boost::math::policies::policy<boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy> >’ requested here
return itrunc(v, policies::policy<>());
^
/Library/Frameworks/R.framework/Versions/3.3/Resources/library/BH/include/boost/math/special_functions/bessel.hpp:256:24: note: in instantiation of function template specialization ‘boost::math::itrunc<
stan::math::var>’ requested here
return bessel_kn(itrunc(v), x, pol);
^
/Library/Frameworks/R.framework/Versions/3.3/Resources/library/BH/include/boost/math/special_functions/bessel.hpp:583:73: note: in instantiation of function template specialization ‘boost::math::detail::cyl_bessel_k_imp<stan::math::var, boost::math::policies::policy<detail::forwarding_arg1, detail::forwarding_arg2, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy> >’ requested here
return policies::checked_narrowing_cast<result_type, Policy>(detail::cyl_bessel_k_imp<value_type>(v, static_cast<value_type>(x), tag_type(), forwarding_policy()), “boost::math::cyl_bessel_k<%1%>(%1%,%1%)”);
^
/Library/Frameworks/R.framework/Versions/3.3/Resources/library/BH/include/boost/math/special_functions/bessel.hpp:589:11: note: in instantiation of function template specialization ‘boost::math::cyl_bessel_k<double, stan::math::var, boost::math::policies::policy<boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy> >’ requested here
return cyl_bessel_k(v, x, policies::policy<>());
thanks.