This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Can I convert Eigen::VectorXi to Eigen::VectorXd?

Tags: None
(comma "," separated)
devcat
Registered Member
Posts
1
Karma
0
I am using RcppEigen on R. I would like to take a double vector from R layer:

RcppExport SEXP testfunc (SEXP a) {
const Eigen::Map<Eigen::VectorXd> vecD(as<Eigen::Map<Eigen::VectorXd> >(a));
But, number is comming as integer, so I need to get it as integer like this :

RcppExport SEXP testfunc (SEXP a) {
const Eigen::Map<Eigen::VectorXi> vecD(as<Eigen::Map<Eigen::VectorXi> >(a));
So, I need to convert it to the double. Can I convert Eigen::VectorXi to Eigen::VectorXd ?
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]