[eigen] Using transpose in expressions

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


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";
}




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