[eigen] Unexpected behavior with rowwise().reverse()

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


I'm not sure if this is a bug or if I'm "doing it wrong":

Program:

#include <eigen\Eigen\Dense>
#include <iostream>

int _tmain(int argc, _TCHAR* argv[])
{
   Eigen::MatrixXd blah(1,5);

   blah << 1 , 2 , 3 , 4 , 5;

   std::cout << blah << std::endl;

   blah = blah.rowwise().reverse();

   std::cout << blah << std::endl;

   blah << 1 , 2 , 3 , 4 , 5;

   blah = blah.rowwise().reverse().eval();

   std::cout << blah << std::endl;

   return 0;
}

Results:
1 2 3 4 5
5 4 3 4 5
5 4 3 2 1

Isn't eigen supposed to detect these scenarios and call eval if necessary?

Thanks for the great tool!
Rob Conde


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