Re: [eigen] compilation failed for not aligned tiny matrix

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



Hi,

ok, here the bug is that computeInverse() expect a PlainMatrixType which in your case is equivalent to TinyRMatrix but without the DontAlign option. Yes that's a bug in Eigen.

But now, I'm wondering why computeInverse is not a template function ? Think about submatrices, or, e.g., to perform: m.transpose().computeInverse(inv); - here m.transpose() is row major and so computeInverse will expect a row major matrix.

Moreover I'm wondering whether computeInverse() is still useful since we can make inv = a.inverse() works in place just like compute inverse..

Benoit ?

gael.


On Tue, Oct 6, 2009 at 2:28 PM, WANG Xuewen <xuewen.wang@xxxxxxxxx> wrote:
Hi,

I'm using the devel branch, and got the a compilation error with the following code:

#include <eigen2/Eigen/Core>
#include <eigen2/Eigen/Array>
#include <eigen2/Eigen/LU>

typedef Eigen::Matrix<double, 4, 4,
                    Eigen::RowMajor | Eigen::DontAlign,
                    4, 4>
      TinyRMatrix;

void TestInverseCompilation()
{
 TinyRMatrix m;
 m.setIdentity();
 TinyRMatrix inverse;
 m.computeInverse(&inverse);
}

the error message is
test.cpp:16: error: no matching function for call to
/usr/include/eigen2/Eigen/src/LU/Inverse.h:259: note: candidates are: void Eigen::MatrixBase<Derived>::computeInverse(typename Eig
en::ei_plain_matrix_type<Derived>::type*) const [with Derived = Eigen::Matrix<double, 4, 4, 3, 4, 4>]


If I change DontAlign to Aligned, it compiles fine. But I'm told that it doesn't make much sense to align/vectorize tiny matrix...

thanks,

Xuewen






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