User talk:⊂⍺m
Jump to navigation
Jump to search
The Falkoff/Iverson quote, while providing illuminating historical context, is a bit misleading—the reduction in inner product does not collapse any axes relative to the result shape, as it is applied only within each enclosure/box of the outer product. Rather, in f/¨ (⊂[⍴⍴x]x)∘.g ⊂[1]y
the enclosure of one axis of each argument, prior to the outer product operation, is responsible for the collapsing of dimensions.
Equivalently from a slightly different angle, if we use the model X⊂⍤(f/)⍤g⍤1⍤1 99⊢Y⍉⍨¯1⌽⍳≢⍴Y
, the collapsing of dimensions is due more generally to ⊂⍤…⍤g⍤1
mapping two vectors to a scalar. Clearly the same holds for …⊂⍤g⍤1…
, i.e., the same expression with the reduction removed.
⊂⍺m (talk) 22:45, 25 June 2023 (UTC) ⊂⍺m
- Iverson's model may have been more like
f⌿⍤(1-≢⍴X)⊢ X g⍤¯1⍤1 99⊢ Y
, so that the flat intermediate result does have this extra axis. Maybe with a transpose like your second example, who knows. In a nested APL,g¨
should be used instead ofg
, but I think with this modification it correctly describes the semantics other than maybe evaluation order. I would say even in your examples there is an extra axis, but it's hidden away by a layer of nesting; forcing everything to be flat makes it literally an array axis at some point. --Marshall (talk) 01:05, 26 June 2023 (UTC)