Reminder for implementing the features requested in this thread: http://forum.kde.org/viewtopic.php?f=74&t=98384&sid=c5804c453b7e843d4488e7cbb3a2da2f Basically, it would be nice to be able to use the min/max operator with a scalar argument, as in: Array4d x; x<<1,-2,3,4; x.max(0);
Created attachment 243 [details] a patch to implement scalar min/max Please find attached a patch that implements this feature. As gael suggested, I made the method an alias to calling min/max with a constant array. The patch also includes a scalar argument method for the matrix class in cwiseMin/Max. thanks!
Oh yah, and everything seems happy with running "make check".
Comment on attachment 243 [details] a patch to implement scalar min/max Review of attachment 243 [details]: ----------------------------------------------------------------- sounds good except that it's missing testing, see test/array.h (for min/max) and test/array_for_matrix.cpp (for cwiseMin/Max)
right... I had looked into writing tests, but wasn't sure where it should go and then didn't. I'll do that shortly. -=Abe
Created attachment 246 [details] A new patch that implements the features and has tests Created a new patch that implements the scalar min/max functions along with the necessary testing routines.
I cannot see anything wrong with it, so I committed the patch (changeset ec430a9cb055). Thanks very much for your help.
glad to be of service! thanks, -=Abe
-- GitLab Migration Automatic Message -- This bug has been migrated to gitlab.com's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.com/libeigen/eigen/issues/400.