[eigen] (vec1*vec2.transpose())*vec3 on 2.0.5/6 |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: Eigen development <eigen@xxxxxxxxxxxxxxxxxxx>
- Subject: [eigen] (vec1*vec2.transpose())*vec3 on 2.0.5/6
- From: Rhys Ulerich <rhys.ulerich@xxxxxxxxx>
- Date: Tue, 29 Sep 2009 18:06:35 -0500
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:from:date:message-id :subject:to:content-type; bh=ykpCZsizxjStXyMGxkqpiwGbTauRtYfy8p2djNRK4Vc=; b=qJk5sKj10OdGxjxXc0qv7ePhvMZAFonPFcX3ybc2bY4egUEblvSx76co7QwI5ossNI RMrjcZCmY2e2PrDQ6sZz09pBN591S3AxHdjwg/3h1vuvbnWqTsXdJeRMi1AkaSyrca7z R+qsKYSAhzg+SmTLLqmdw2t7KrsjpSrsNQF5U=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; b=vE5HrIJdWYwywakzQs4pdx9Sc7l5XGrWwt7IawZSmIljnTggsi0hPk7dAhOWjbpxG6 3CR6RH5LgbyJgA58Dz5eGWKggUTfUiBZh/xAOZc+E6oA3AKx26eJJKD0rRC7u4dM0RK3 mxBYG9tXj9zwIuiJurlL/2TbQKrgcK5OruuG4=
Hi all,
On 2.0.5 and 2.0.6 I've noticed that
(vec1*vec2.transpose())*vec3
errors out at compile time while
(vec1*vec2.transpose()).eval()*vec3
works just fine, but I found that out by blind trial-and-error.
Two questions:
1) Is the observed behavior legit?
2) If (1), then what piece of insight is escaping me for why the former doesn't compile?
Sample code attached.
- Rhys
#include <iostream>
#include <Eigen/Core>
int main(int argc, char **argv)
{
Eigen::Vector3d a(1,2,3);
Eigen::Vector3d b(4,5,6);
Eigen::Vector3d c(7,8,9);
// Desired computation
Eigen::Matrix3d a_outer_b(a*b.transpose());
std::cout << a_outer_b*c << std::endl;
// Attempts to express desired computation in one line
// std::cout << (a*b.transpose())*c << std::endl; /* breaks */
std::cout << (a*b.transpose()).eval()*c << std::endl; /* works */
}