adcomp
adcomp copied to clipboard
Simulate method not working for scaled separable term
Reported by @fishfollower : The following template does not compile.
#include <TMB.hpp>
template<class Type>
Type objective_function<Type>::operator() ()
{
using namespace density;
array<Type> omega;
vector<Type> rho;
Type s = 1;
SIMULATE {
// Separable simulate compiles as expected
SEPARABLE(AR1(rho(1)), AR1(rho(0))).simulate(omega);
// Scaling a factor compiles as expected
SEPARABLE(SCALE(AR1(rho(1)), s), AR1(rho(0))).simulate(omega);
// Scaling entire kronecker product does not compile (bug)
SCALE(SEPARABLE(AR1(rho(1)), AR1(rho(0))), s).simulate(omega);
}
return 0;
}