Post date: Feb 11, 2016 3:39:37 PM
The part for the Data comes from here.
http://eigen.tuxfamily.org/dox-devel/group__TopicStlContainers.html
and the Key comes from here
http://www.alecjacobson.com/weblog/?tag=map
Put them all together and you get
map<VectorXd,
VectorXd,
function<int(const VectorXd&, const VectorXd&)>,
aligned_allocator<pair<const VectorXd&, VectorXd&> > >
m([](const VectorXd& a, const VectorXd& b)->bool
{
return lexicographical_compare(
a.data(), a.data()+a.size(),
b.data(), b.data()+b.size());
});
VectorXd X1(3), x1(2);
X1 << 1, 2, 3;
x1 << 2, 4;
VectorXd X2(3), x2(4);
X2 << 2, 3, 4;
x2 << 4, 5, 6, 7;
VectorXd X3(3), x3(3);
X3 << 3, 4, 5;
x3 << 5, 4, 3;
m.insert(pair<VectorXd, VectorXd>(X1, x1));
m.insert(pair<VectorXd, VectorXd>(X2, x2));
m.insert(pair<VectorXd, VectorXd>(X3, x3));
std::cout << m[X2] << std::endl;