Re: [eigen] problem with selfadjointView

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


2010/8/18 Ben Goodrich <bgokgm@xxxxxxxxxxxxxx>
Hi guys,

I have gotten sidetracked from the stuff I promised to do to add
non-pivoting LDL' to eigen3, but since we decided to just add a new
class for it, is that still fine to go in this week or next?

I'd say yes, the biggest factor is that it be a good, complete patch (with unit test and doxygen /**...*/ comments) so it's easy for us to review.

Benoit

 

My unrelated question is that I wanted to compare the speed of

double foo(const VectorXd &x, const MatrixXd &A) {
 return ((x.transpose() * A * x).eval())(0,0);
}

with

double bar(const VectorXd &x, const MatrixXd &A) {
 return ((x.transpose() * A.selfadjointView<Lower>() * x).eval())(0,0);
}

but g++ does not like x.transpose() * A.selfadjointView<Lower>()
although it likes A.selfadjointView<Lower>() * x. The compiler error
below is not very informative to me, but maybe someone else
understands it. I guess x.transpose() is not yet a matrix so it does
not understand how to multiply it by a selfadjointView?

Ben

bgoodrich@Room320:/tmp$ g++ -O2 -DNDEBUG benchmark.cc -o benchmark.o
benchmark.cc: In function ‘double bar(const Eigen::VectorXd&, const
Eigen::MatrixXd&)’:
benchmark.cc:33: error: invalid use of incomplete type ‘struct
Eigen::SelfadjointProductMatrix<Eigen::Transpose<Eigen::Matrix<double,
-0x00000000000000001, 1, 0, -0x00000000000000001, 1> >, 0, true,
Eigen::Matrix<double, -0x00000000000000001, -0x00000000000000001, 0,
-0x00000000000000001, -0x00000000000000001>, 17, false>’
/tmp/eigen/Eigen/src/Core/SelfAdjointView.h:59: error: declaration of
‘struct Eigen::SelfadjointProductMatrix<Eigen::Transpose<Eigen::Matrix<double,
-0x00000000000000001, 1, 0, -0x00000000000000001, 1> >, 0, true,
Eigen::Matrix<double, -0x00000000000000001, -0x00000000000000001, 0,
-0x00000000000000001, -0x00000000000000001>, 17, false>’
In file included from /tmp/eigen/Eigen/Core:288,
               from /tmp/eigen/Eigen/Dense:1,
               from benchmark.cc:1:
/tmp/eigen/Eigen/src/Core/SelfAdjointView.h: In function
‘Eigen::SelfadjointProductMatrix<OtherDerived, 0,
OtherDerived::IsVectorAtCompileTime, MatrixType,
Eigen::SelfAdjointView<MatrixType, Mode>::Mode, false>
Eigen::operator*(const Eigen::MatrixBase<OtherDerived>&, const
Eigen::SelfAdjointView<MatrixType, Mode>&) [with OtherDerived =
Eigen::Transpose<Eigen::Matrix<double, -0x00000000000000001, 1, 0,
-0x00000000000000001, 1> >, MatrixType = Eigen::Matrix<double,
-0x00000000000000001, -0x00000000000000001, 0, -0x00000000000000001,
-0x00000000000000001>, unsigned int UpLo = 1u]’:
benchmark.cc:33:   instantiated from here
/tmp/eigen/Eigen/src/Core/SelfAdjointView.h:124: error: return type
‘struct Eigen::SelfadjointProductMatrix<Eigen::Transpose<Eigen::Matrix<double,
-0x00000000000000001, 1, 0, -0x00000000000000001, 1> >, 0, true,
Eigen::Matrix<double, -0x00000000000000001, -0x00000000000000001, 0,
-0x00000000000000001, -0x00000000000000001>, 17, false>’ is incomplete
/tmp/eigen/Eigen/src/Core/SelfAdjointView.h:128: error: invalid use of
incomplete type ‘struct
Eigen::SelfadjointProductMatrix<Eigen::Transpose<Eigen::Matrix<double,
-0x00000000000000001, 1, 0, -0x00000000000000001, 1> >, 0, true,
Eigen::Matrix<double, -0x00000000000000001, -0x00000000000000001, 0,
-0x00000000000000001, -0x00000000000000001>, 17, false>’
/tmp/eigen/Eigen/src/Core/SelfAdjointView.h:59: error: declaration of
‘struct Eigen::SelfadjointProductMatrix<Eigen::Transpose<Eigen::Matrix<double,
-0x00000000000000001, 1, 0, -0x00000000000000001, 1> >, 0, true,
Eigen::Matrix<double, -0x00000000000000001, -0x00000000000000001, 0,
-0x00000000000000001, -0x00000000000000001>, 17, false>’





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