Registered Member
|
I mean I want to make all the element which is larger than a value x to be x.
|
Moderator
|
For a lower bound, if A is an Array:
A = A.max(x); and if M is A Matrix: M = M.array().max(x); EDIT: For an upper bound, replace max by min. |
Registered Member
|
Thank you! So, is that a usual way to avoid inf before using M.array().exp()? |
Registered Member
|
It is strange, when I use max it acts like min, when I use min it acts like max.
the result is: 600 200 30 600
the result is 800 600 600 700 |
Moderator
|
Of course, if you want an upper bound you have to replace "max" by "min" in my answer. min (resp. max) return the minimum (resp. maximum) coefficient wise.
|
Registered users: bartoloni, Bing [Bot], Evergrowing, Google [Bot], ourcraft