The problem here is that .& isn't defined as an operator, so there's
no broadcasting form of & at all.  At a guess I'd say that's just an
oversight, in which case making a github issue is the right thing.

On the other hand, the broadcasting versions of .* etc are all defined
on generic AbstractArrays, so also work on BitArrays.  Multiplication
of booleans (when represented numerically as {0,1}) is equivalent to
logical and, so either of the following will work

    inside_R_box .* inside_Z_box
    inside_Z_box .* inside_R_box

The alternative version

    inside_R_box * inside_Z_box

works only when R is a column and Z is a row, since matrix
multiplication gives you the outer product which amounts to the same
thing as broadcasting in this particular case.  I think this
alternative is a bit fragile and expresses the wrong semantics
however: Matrix multiplication is composition of linear maps, but
there's no linear maps in sight here!

Cheers,
~Chris

On Wed, May 21, 2014 at 10:09 PM, Tomas Lycken <[email protected]> wrote:
> Indeed it does - thanks! - but I don't understand why it works... Is it some
> funkiness with the way * is implemented for BitArrays, or is it a logical
> consequence of the usual matrix multiplication rules? Would you care to
> explain the logic behind it to me? =)
>
> // T
>
>
> On Wednesday, May 21, 2014 2:04:49 PM UTC+2, Yuuki Soho wrote:
>>
>> Doesn't
>>
>> inside_R_box * inside_Z_box
>>
>> gives what you want ?
>>
>>
>

Reply via email to