Unexpected result with inner product

2022-01-25 Thread Elias Mårtenson
Consider the following code: *A←3 4⍴1 3 2 0 2 1 0 1 4 0 0 2B←4 2⍴4 1 0 3 0 2 2 0Q←{⍺/⍵} (A≠0) +.Q B* My reading (and implementation) of the ISO spec suggests the output should be the following: ┏━━━┓ ┃4 6┃ ┃6 4┃ ┃6 1┃ ┗━━━┛ However, in GNU APL I get this: ┏→━━┓ ↓┏⊖┓ ┏⊖┓┃ ┃┃0

Re: Unexpected result with inner product

2022-01-25 Thread Christian Robert
On NARS2000.64 it gives: ⎕fmt (A≠0) +.Q B ┌2───┐ 3┌0─┐┌0─┐│ ││ 0││ 0││ │└~─┘└~─┘│ ││ │┌0─┐┌0─┐│ ││ 0││ 0││ │└~─┘└~─┘│ ││ │┌0─┐┌0─┐│ ││ 0││ 0││ │└~─┘└~─┘2 └∊───┘ so, the same thing as gnu-apl Xtian. On 2022-01-25 23:25, Elias Mårtenson wrote: Consider the following

Re: Unexpected result with inner product

2022-01-25 Thread Elias Mårtenson
Dyalog as well. However, both my implementation (KAP) and ngn/APL gives what I consider the expected result. Regards, Elias On Wed, 26 Jan 2022 at 12:37, Christian Robert wrote: > On NARS2000.64 it gives: > > ⎕fmt (A≠0) +.Q B > ┌2───┐ > 3┌0─┐┌0─┐│ > ││ 0││ 0││ > │└~─┘└~─┘│ > ││