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

Eigen::Map<> on const array

Tags: None
(comma "," separated)
eudoxos
Registered Member
Posts
36
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
3447
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
36
Karma
0

Re: Eigen::Map<> on const array

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


Bookmarks



Who is online

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