Hi,

This seems pretty trivial, but I'm stuck on how to perform conditional
application of a verb on a multidimensional array as defined by a bitmask
of the same shape as the operand array. Is there a typical idiom for that?

For example,

operand =. 2 2 2 $ 3 2 2 3 2 3 3 2

bitmask =. 2 2 2 $ 1 0 0 1 0 1 1 0

operator =. >:

desired_result =. 2 2 2 $ 4 2 2 4 2 4 4 2


I tried looking at the doc, but I wasn't able to formulate a nice solution.


Thanks!

Raoul
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to