Registered Member
|
hello,
I would like to pass an integer as default VectorXi argument as function argument, so I would like to define the int as a vector of size 1. I tried different things, for example comma initializer or
for example but i get warnings
passing
actually works, but what if I want to pass a vector with two elements? Any help appreciated. Thanks, Marco |
Moderator
|
Your first example is perfectly fine, except that you're missing the Eigen:: namespace prefix.
Also, I guess that those warnings come from your IDE, and not from the compiler. In general don't believe to much in those warnings as IDE's parsers are rather limited regarding templates. |
Registered Member
|
Thanks ggael. Then the problem is not Eigen. I should have specified I am using RcppEigen in Rstudio. Maybe it depends on that, it is difficult for me to now if thewarnings and errors come from the compiler. What happens is that it compiles giving warnings
and when I run chk() I get the following error
maybe i should ask the Rcpp community. |
Moderator
|
ah, right, this might rather be an issue with Rcpp.
|
Registered users: bartoloni, Bing [Bot], Evergrowing, Google [Bot]