adcomp icon indicating copy to clipboard operation
adcomp copied to clipboard

Simulate method not working for scaled separable term

Open kaskr opened this issue 4 years ago • 0 comments

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;
}

kaskr avatar Jun 24 '20 14:06 kaskr