Re: [eigen] refactoring fork: some news

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]


Hi,

This is indeed orthogonal to this question. What you're asking for is
something you can already do with Map:

MatrixXf mat(r,c);
MatrixXf::Map mat_reshaped(mat.data(), r2, c2);
or
VectorXf::Map mat_reshaped(mat.data(), r*c);

etc...

then of course it's legitimate to want a nicer syntax, so it would be
worthwhile, i think, to add a convenience function for that. Perhaps
reshaped(), I don't know. Keir suggested the same to me recently.

Benoit


2009/12/20 Manuel Yguel <manuel.yguel@xxxxxxxxx>:
> Hi,
> I am practically sure that it is off the point however my concern is
> that in some applications, it is necessary to view a matrix of size
> nxm as a vector 1xnm or pxq with nm = pq.
> I wonder if this is the good moment to raise my case, but is this
> possible to consider having a matrix() function that takes two
> parameters that are compatible with the number of coefficients in the
> array: matrix(int rows, int cols )  with rows*cols = size()
> such that we can have for a 3x4 matrix, a 12x1 vector or a 2x6 matrix
> or a 4x3 matrix etc... assuming that the coefficients are given by the
> storage order row major or column major.
>
> - sincerely,
>
> Manuel
>
>
>



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/