[eigen] Clamping the coeffs of a matrix

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


Ho hai,

  I'm working on reaction-diffusion problems. I need to clamp the coefficients of a dense matrix, as following :
W(i, j) = max(a, W(i, j))

 A more generalization would be
W(i, j) = min(b, max(a, W(i, j)))  for clamping in [a ,b]

Questions :
  1) Can I do it in a better way than a naive loop over the coefficients ?
  2) I know that the max and min operator are in the SSE instruction set, thus, can I benefit from it ?

Regards,
Alex







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