I am trying to compile the following code. Please see below what I have tried so far. Is there anything that I am missing. Any help would be appreciated.
#include <RcppArmadillo.h>
// [[Rcpp::depends(RcppArmadillo)]]
using namespace Rcpp;
// [[Rcpp::export]]
List beta(const arma::rowvec beta,
const int n,
const int L1,
const int p,
const arma::mat YWeight1,
const arma::mat z){
double S0=0;
for(int i = 0;i < n; ++i){
arma::rowvec zr = z.rows(i,i);
S0 += exp(arma::as_scalar(beta*zr.t()));
}
List res;
res["1"] = S0;
return(res);
}
I can't copy the error but this is what I am getting.
no match for call to '(Rcpp::traits::input_parameter<const arma::Row<double>
and so on...