Include c++ code in Stan model?


#1

Is there a way to include foo.hpp in bar.stan input deck? This assumes make processes the compiling & linking properly of course.


#2

If it’s Rstan: http://mc-stan.org/rstan/articles/external.html. There’s an argument “includes” available in the stan_model function.


#3

Thanks. Any chance to do it in cmdstan?


#4

There is a section about it in the CmdStan documentation.


#5

Blech I’m late, but pg 24 of the 2.17.1 CmdStan manual, “4.4. Using External C ++ Code”


#6

Thanks guys.