bug-apl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-apl] multiple inner product


From: Juergen Sauermann
Subject: Re: [Bug-apl] multiple inner product
Date: Thu, 07 Jul 2016 12:59:55 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Thunderbird/31.4.0

Hi,

Dyalog APL and GNU APL use different reduction styles and both are allowed in the ISO standard.
I had a brief look at the example and my impression is that the differences for f.g in Dyalog APL
and in GNU APL are primarily caused by the different reduction styles.

I also tested IBM APL2 and they return yet another result which is different from Dyalog APL but
also different from GNU APL.

The reason for that seems to be that for an f/, IBM APL2 encloses the reduction result one level deeper
than GNU APL. If I remember correctly then at the time when I wrote the reduction code I believed that
enclosing a scalar would always be a no-op while in fact only enclosing a simple scalar is a no-op.

I will look into making GNU APL compatible to IBM APL2, but I am afraid that the difference between
IBM APL2 and Dyalog APL will remain.

/// Jürgen


On 07/07/2016 04:59 AM, Kacper Gutowski wrote:
On 6 July 2016 at 20:31, Xiao-Yong Jin wrote:
I’m not sure which one is at fault here.  Any idea?
The standard explicitly says A f.g B ←→ f/A g B when A & B vectors.

      A←⊂[1]⍳2 3
      B←⊂[1]10×⍳2 3

GNU APL is at fault here:

      {⍺+.+⍵}/A+B
  165 242
      (+.+)/A+B
 209 198

But in the +.(+.+) case, it's Dyalog that gives unexpected results:

      +/A(+.+)B
  33 66  66 66
      A+.(+.+)B
  99 132

-k




reply via email to

[Prev in Thread] Current Thread [Next in Thread]