Inner Product: Difference between revisions

Jump to navigation Jump to search
9 bytes removed ,  11:48, 26 January 2022
Line 118: Line 118:
Implementations differ on the exact behaviour of inner product when the right operand is not a [[scalar function]]. It follows from page 121 of the ISO/IEC 13751:2001(E) [[standard]] specifies that <source lang=apl inline>X f.g Y</source> is equivalent to <source lang=apl inline>⊃⍤0 f/¨ (⊂[⍴⍴x]x)∘.g ⊂[1]y</source>. This is indeed what [[APL2]], [[APLX]], and [[ngn/apl]] follow, while [[Dyalog APL]] and [[GNU APL]] use <source lang=apl inline>⊃⍤0 f/¨ (⊂[⍴⍴x]x)∘.(g¨) ⊂[1]y</source>.
Implementations differ on the exact behaviour of inner product when the right operand is not a [[scalar function]]. It follows from page 121 of the ISO/IEC 13751:2001(E) [[standard]] specifies that <source lang=apl inline>X f.g Y</source> is equivalent to <source lang=apl inline>⊃⍤0 f/¨ (⊂[⍴⍴x]x)∘.g ⊂[1]y</source>. This is indeed what [[APL2]], [[APLX]], and [[ngn/apl]] follow, while [[Dyalog APL]] and [[GNU APL]] use <source lang=apl inline>⊃⍤0 f/¨ (⊂[⍴⍴x]x)∘.(g¨) ⊂[1]y</source>.


== Model ==
as [[Roger Hui]] writes:<ref>[[Roger Hui]]. ''inner product''. Internal Dyalog email. 24 July 2020.</ref>
[[Roger Hui]] writes:<ref>[[Roger Hui]]. ''inner product''. Internal Dyalog email. 24 July 2020.</ref>
<blockquote>
<blockquote>
The following dop models inner product in Dyalog APL, with caveats.  If you find a case where <source lang=apl inline>f.g</source> differs from <source lang=apl inline>f IP g</source>, not covered by the caveats, I'd be interested.
The following dop models inner product in Dyalog APL, with caveats.  If you find a case where <source lang=apl inline>f.g</source> differs from <source lang=apl inline>f IP g</source>, not covered by the caveats, I'd be interested.

Navigation menu