【发布时间】:2019-07-24 15:38:24
【问题描述】:
我正在尝试编译以下代码。请参阅下面我到目前为止所尝试的内容。有什么我想念的吗。任何帮助,将不胜感激。
#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);
}
我无法复制错误,但这就是我得到的。
no match for call to '(Rcpp::traits::input_parameter<const arma::Row<double>
等等……
【问题讨论】:
-
感谢您的快速回复。更改后我仍然收到相同的错误。我还将 beta 更改为 beta.t() 只是为了使其与 S0 += 兼容。
标签: rcpp rcpparmadillo