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:
> 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
>
> ------------------------------------------------------------------------------
> _______________________________________________
> ViennaCL-support mailing list
> ViennaCL-support@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/viennacl-support
>


------------------------------------------------------------------------------
_______________________________________________
ViennaCL-support mailing list
ViennaCL-support@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/viennacl-support

Reply via email to