[ViennaCL-support] Element-wise comparisons

2015-06-13 Thread Matthew Lai
Hello! Is there a way to do element-wise comparisons? In particular, I have a matrix of positive and negative numbers, and I'd like to set all the negative elements to 0. I can't seem to find this in the documentations. Thanks! Matthew -

Re: [ViennaCL-support] Element-wise comparisons

2015-06-13 Thread Karl Rupp
Hi Matthew, you can compose functionality from here: http://viennacl.sourceforge.net/doc/manual-operations.html#manual-operations-blas1 For example, to set all negative entries to zero, use B = (A + element_fabs(A)) / 2.0 Best regards, Karli On 06/13/2015 10:32 PM, Matthew Lai wrote: > Hell

Re: [ViennaCL-support] Element-wise comparisons

2015-06-13 Thread Matthew Lai
Thanks! Matthew On 2015-06-13 9:56 PM, Karl Rupp wrote: > Hi Matthew, > > you can compose functionality from here: > http://viennacl.sourceforge.net/doc/manual-operations.html#manual-operations-blas1 > > > > For example, to set all negative entries to zero, use > B = (A + element_fabs(A)) / 2.