I'm having a problem using stan::math::multinomial_log. My test script
(taken from the stan math test script) looks like this:
#include <stan/math/prim/mat/prob/multinomial_log.hpp>
#include <RcppEigen.h>
using namespace Eigen;
// [[Rcpp::export]]
double test_multinomial_log() {
std::vector<int> ns;
ns.push_back(1);
ns.push_back(2);
Eigen::Matrix<double,Dynamic,1> theta(2,1);
theta << 0.2, 0.8;
return stan::math::multinomial_log<true>(ns,theta);
}
/*** R
test_multinomial_log()
*/
The error I get is
In file included from test.cpp:1:
In file included from
/Library/Frameworks/R.framework/Versions/3.2/Resources/library/StanHeaders/include/stan/math/prim/mat/prob/multinomial_log.hpp:9:
/Library/Frameworks/R.framework/Versions/3.2/Resources/library/StanHeaders/include/stan/math/prim/scal/err/check_nonnegative.hpp:40:38:
error: invalid operands to binary expression ('std::__1::vector<int,
std::__1::allocator<int> >' and 'int')
&& !(stan::get(y, n) >= 0))
~~~~~~~~~~~~~~~ ^ ~
Apologies if there is a specific stan-math mailing list I should be
asking this on!
Thank you in advance,
David.
--
David A. Knowles,
Stanford University.
E-mail:
know...@gmail.com
Web:
http://cs.stanford.edu/~davidknowles/