[eigen] Clamping the coeffs of a matrix |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: [eigen] Clamping the coeffs of a matrix
- From: Alexandre Devert <marmakoide@xxxxxxxx>
- Date: Fri, 22 Jan 2010 23:16:50 -0800 (PST)
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.fr; s=s1024; t=1264231010; bh=xJQGMdrPLgX0JuBT4MgMSKePEURcoKQpxlRtL5keyzE=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=2C9UWtVwsiIi4Z/5zgGBFwuKDvKUUelsbMbXCwOs7Vp6FqyAEjNJJUUz9i6Pwmary6LMsIPTNjLBH0I2JSNJxRIkbelnNW92NxL5bTdRniHuUokOU9WwDhr8xwH3F90Ut1sBX7+93hcWRPV/QW6IDVdeKweSC3zEEwb6aEhfSe8=
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.fr; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=f8BQtBU+F0MnzQfzCPn+ksRRrUhaic91/Y24pL3mzaCUfs89ysf7jhwsB5SwND70ohRGROOeM64VGr8erK6QNEpEE0YccUWOW32KmM68+SvsE/GsYA05z+Phj6PLrHJRe3dq9FVTx9M/CI0V+tcqbMpoDMSNGMtXMNrnvVcrBbY=;
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