• To: eigen@xxxxxxxxxxxxxxxxxxx
• Subject: Re: [eigen] problem with selfadjointView
• From: Benoit Jacob <jacob.benoit.1@xxxxxxxxx>
• Date: Thu, 19 Aug 2010 08:41:59 -0400
• Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=qvKR6bjwvfkwtQfn8bsKh1qXVRrNn+TDq+bv5L02wnVSHKU2D78z1bRehjYZlELd/W kAuhIEB++dzx7zXxO6j+J8qz62XxEmSrESBqn7JEJ98xA9OZcCvM9nmQPvIT0EnwMDva 05Wu5uaJaXljNU/zOEuEtfesnsQl3RitfNbII=

2010/8/18 Ben Goodrich
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
-0x00000000000000001, 1, 0, -0x00000000000000001, 1> >, 0, true,
Eigen::Matrix<double, -0x00000000000000001, -0x00000000000000001, 0,
-0x00000000000000001, -0x00000000000000001>, 17, false>’
-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:
OtherDerived::IsVectorAtCompileTime, MatrixType,
Eigen::operator*(const Eigen::MatrixBase<OtherDerived>&, const
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
-0x00000000000000001, 1, 0, -0x00000000000000001, 1> >, 0, true,
Eigen::Matrix<double, -0x00000000000000001, -0x00000000000000001, 0,
-0x00000000000000001, -0x00000000000000001>, 17, false>’ is incomplete
incomplete type ‘struct
-0x00000000000000001, 1, 0, -0x00000000000000001, 1> >, 0, true,
Eigen::Matrix<double, -0x00000000000000001, -0x00000000000000001, 0,
-0x00000000000000001, -0x00000000000000001>, 17, false>’