简体   繁体   中英

Elementwise comparison of two matrices in Eigen (C++)

I have MatrixXf A & MatrixXf B and I want to create a new matrix MatrixXf C with max values for each index ie

C(i,j) = max(A(i,j), B(i,J);

Does Eigen have a function to do this?

A.cwiseMax(B) can also be used.

Check http://eigen.tuxfamily.org/dox/group__QuickRefPage.html#title6 for reference

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM