As we know that in c++, the Eigen::MatrixXf can be used to define a Matrix with the dimension of (3*3), but if I want define an array (named a) which is composed by 10 matrices of with the dimension of (3*3), could I define it in this way:
Eigen::MatrixXf a [10]
If not, How can I define this array?
Furthermore, How can I quote the ith element of this array?
Thanks & best wishes
you can certainly make an array of arrays of arrays etc.
you can use a typedef to do this with arrays, or vectors, or whatever.
it would probably look like
matrixtype x[10];
x[0].matrix[row][col] = 3.14;
or something like that representing an array (x) of matrices.
there seems to be a lot of matrix stuff on here lately. Ill say it again, one-d is your friend when you get to the advanced stuff. Its easier to plug in to clapack, its easier to transpose or resize or reshape or factor or dozens of other operations. Storing them in an array of one-d matrices is still ok, but the actual deep storage works better 1d; here, that would be the 'matrix' type under x.
Presumably you are referring to the Eigen template library, the online documentation for which is here: http://eigen.tuxfamily.org/dox/GettingStarted.html
I recommend you read that documentation as it has examples showing how to do the kinds of things you are asking about.