[eigen] problem with selfadjointView |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: [eigen] problem with selfadjointView
- From: Ben Goodrich <bgokgm@xxxxxxxxxxxxxx>
- Date: Wed, 18 Aug 2010 23:30:01 -0400
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:content-type:content-transfer-encoding; bh=CqCPF4p8DJUSyDWJXbonZL2BeIH3KDZbnh/6ZgX9Po4=; b=Ba80e2veZD4la/+RvlxesbwxCJ87LxKxrV/YYbCGVHkCAUBbKFyS/QMK3dzAUykyVX vqn0hfyI+k9MhmgI4ZDg9Ve+NxbK1qF1v8uyiYqa5Rh1CnmcniTbxpD2mIXXCL/r4cmC ZTLHyBDFkv5LrAfXMnuFP8nZgbYZDT9gGSyyo=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; b=rjsOOQR2QOSS5qZIZAXYyROlDOFur8jsI4l+RBegFQw0yCkj0kDaWWkM235NzEJTJa L6+ylLlnSqM3zSwH4GSEZmeAr8elXGeWjog6S48Bd+FWUfyijVm9nzSqPBtlnPul2uv5 vUX+k3flIDASpjz0NQ/Mh/VfPMLr1l1FYgbts=
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?
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>’