Re: [eigen] Using transpose in expressions

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


I can confirm this, also on 3.2.8 and 3.2-head. It does work on the 3.3 branch, however (which has a significantly different evaluator structure).

I don't know how to best fix this (I'm not _that_ familiar with Eigen's internals). Meanwhile, you can work-around this by by adding an .eval() before or after the .transpose()

Christoph

On 2016-03-26 13:51, Brad Bell wrote:
Why does the following program  work when ERROR_CASE is zero and
generates a compile error when ERROR_CASE is one
(I am using eigen-3.2.7).

# include <iostream>
# include <Eigen/Core>
# define ERROR_CASE 1
int main(void)
{   typedef Eigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic> matrix;
     //
     matrix A = matrix::Identity(2, 2);
# if ERROR_CASE
     matrix C = A * (A * A).transpose();
# else
     matrix C = A * A * A.transpose();
# endif
     //
     std::cout << "C = \n" << C << "\n";
}





--
 Dipl. Inf., Dipl. Math. Christoph Hertzberg

 Universität Bremen
 FB 3 - Mathematik und Informatik
 AG Robotik
 Robert-Hooke-Straße 1
 28359 Bremen, Germany

 Zentrale: +49 421 178 45-6611

 Besuchsadresse der Nebengeschäftsstelle:
 Robert-Hooke-Straße 5
 28359 Bremen, Germany

 Tel.:    +49 421 178 45-4021
 Empfang: +49 421 178 45-6600
 Fax:     +49 421 178 45-4150
 E-Mail:  chtz@xxxxxxxxxxxxxxxxxxxxxxxx

 Weitere Informationen: http://www.informatik.uni-bremen.de/robotik



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