固有マップをクラスの定義に入れようとしましたが、コンパイラを通過できません。以下は「ex.cc」ファイルです。
#include <iostream>
#include <eigen3/Eigen/Dense>
using namespace Eigen; using namespace std;
class bc{
double a[10];
Map<ArrayXd> b(a, 10);
};
int main(){
bc x;
return 0;
}
コンパイラは次のように述べています。
ex.cc:6:19: error: ‘a’ is not a type
ex.cc:6:22: error: expected identifier before numeric constant
ex.cc:6:22: error: expected ‘,’ or ‘...’ before numeric constant
何故かはわからない。Map をクラスに入れることを除いて、ここで説明したとおりに行っています。