Dear all,

I’m opening this thread to ask some questions about issue #1011, the GP Functor specification. It’s been beautifully outlined for me, to make my job a lot easier/faster. I’m anticipating mostly C++ questions.

So I’m looking at the algebra solver to see how we’re passing in functional arguments. It looks like all the test cases written are declared as a struct, and then passed into the algebra solver with no arguments. I’ve also check out Bob’s lotka-volterra test case to see how user defined functions are are generated in C++, looks like we’ve got about the same thing as in the test cases (cmdstan 2.18):

```
struct dz_dt_functor__ {
template <typename T0__, typename T1__, typename T2__, typename T3__>
std::vector<typename boost::math::tools::promote_args<T0__, T1__, T2__, T3__>::type>
operator()(const T0__& t,
const std::vector<T1__>& z,
const std::vector<T2__>& theta,
const std::vector<T3__>& x_r,
const std::vector<int>& x_i, std::ostream* pstream__) const {
return dz_dt(t, z, theta, x_r, x_i, pstream__);
}
};
```

So a few questions…

- can I assume any user defined function is generated in c++ as a struct?
- with that said, for testing functional stuff can I just implement my own struct, as what’s done in:
`test/unit/math/rev/mat/functor/util_algebra_solver.hpp`

, for say, the RBF (cov_exp_quad)? - will the functionality break if a struct becomes a class? are there any C++ conventions we should follow?
- anything else I can do to make sure what I’ve written is compatible with the language?