Reply to topic

Eigen::Map<> on const array

eudoxos
Registered Member
Posts
35
Karma
0

Eigen::Map<> on const array

Wed Aug 31, 2011 10:00 am
Hi, I would like to map a part of const array, it that possible?
Code: Select all
#include<eigen3/Eigen/Core>
using namespace Eigen;
int main(){
   const double a[4];
   Map<Vector2d> b(&a[1]);
}

obviously gives
Code: Select all
bb.cc:5:23: error: invalid conversion from ‘const double*’ to ‘double*’

Thanks!
User avatar ggael
Moderator
Posts
3383
Karma
19
OS

Re: Eigen::Map<> on const array

Wed Aug 31, 2011 6:32 pm
sure, use Map<const Vector2d>
eudoxos
Registered Member
Posts
35
Karma
0

Re: Eigen::Map<> on const array

Wed Aug 31, 2011 7:16 pm
Oops - thanks!

 
Reply to topic

Bookmarks



Who is online

Registered users: akontsevich, andrewsanderson, Baidu [Spider], Bing [Bot], Exabot [Bot], Google [Bot], kamathraghavendra, Majestic-12 [Bot], Metallicow, Ozkrita, Sogou [Bot], Yahoo [Bot]