Re: [eigen] Bug with cwiseMin / cwiseMax

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


Am 06.07.2015 um 17:16 schrieb Mathieu Dutour:
void PrintMatrix(MyMatrix<double> const& eMat)

Instead of that method, you can write:
  std::cerr << eMat;

   M1.cwiseMax(M2);

This method does not change anything, but returns a new matrix (technically, a matrix expression). You can assign this to a new matrix or to either of M1/M2:
  M1 = M1.cwiseMax(M2);

Or you can directly print it:
  std::cerr << M1.cwiseMax(M2);

Or use it in other expressions:
  MyMatrix<double> M3 = M1.cwiseMin(M2) * M1.cwiseMax(M2);


Christoph


--
----------------------------------------------
Dipl.-Inf., Dipl.-Math. Christoph Hertzberg
Cartesium 0.049
Universität Bremen
Enrique-Schmidt-Straße 5
28359 Bremen

Tel: +49 (421) 218-64252
----------------------------------------------



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