I’m trying expose some functions from my model but I keep getting an error. The below example code when compiled returns an error if foo1
is not commented out.
functions {
int foo0(real x) {
return 1;
}
vector foo1(real x) {
return rep_vector(1.0, 2);
}
vector foo2() {
return rep_vector(1.0, 2);
}
}
This is what I get
> test_model <- cmdstan_model("src/test.stan", compile_standalone = TRUE)
Compiling Stan program...
Compiling standalone functions...
Error in 1:first_decl : NA/NaN argument
In addition: Warning message:
In readLines(stan_file) : incomplete final line found on 'src/test.stan'
Operating System: Mac M2 Pro 13.6
Interface Version: cmdstanr 0.6.1, cmdstan 2.33.1
Compiler/Toolkit: ?
Thank you!