I want to use one
or eye
function in Armadillo
to construct matrices or vectors. However, it does not allow me to do so. Here is a sample code:
#include <RcppArmadillo.h>
// [[Rcpp::depends(RcppArmadillo)]]
using namespace Rcpp;
// [[Rcpp::export]]
SEXP Generate(arma::mat Mat){
arma::mat Mat_2 = ones<mat>(5,6);
}
error message reminds me of use of undeclared idenfier of 'mat'
. When I remove <mat>
, another massage says use of undeclared idenfier of 'ones'
.
I looked up the Armadillo tutorial which includes the ones
function. I wonder why my code fails to call it. Did I miss something?