Outer Product: Difference between revisions

Jump to navigation Jump to search
48 bytes added ,  08:56, 26 August 2023
Line 141: Line 141:
However, it does not allow for creating a Cartesian pairing involving cells of the left argument specified with negative left rank L (except trivially, in cases in which Table's application has no effect, e.g. <syntaxhighlight lang=j inline>u"2 _"_ 1/</syntaxhighlight>). This is because negative assigned rank in J is encoded as infinite rank; in J's terminology, negative rank is "internal rank" only.
However, it does not allow for creating a Cartesian pairing involving cells of the left argument specified with negative left rank L (except trivially, in cases in which Table's application has no effect, e.g. <syntaxhighlight lang=j inline>u"2 _"_ 1/</syntaxhighlight>). This is because negative assigned rank in J is encoded as infinite rank; in J's terminology, negative rank is "internal rank" only.
<syntaxhighlight lang=j>
<syntaxhighlight lang=j>
   +b.0
   }.+b.0         NB. dyadic ranks of +
0 0 0
0 0 0
   }.+"_1 _2 b.0  NB. the dyadic ranks of derived verb +"_1 _2 as seen by Table
   }.+"_1 _2 b.0  NB. dyadic ranks of derived verb +"_1 _2 as seen by Table
_ _
_ _
</syntaxhighlight>
</syntaxhighlight>
{{Works in|[[J]]}}
Given the <syntaxhighlight lang=j inline>u"(lu, _)</syntaxhighlight> definition of Table, even in a hypothetical J dialect in which assignment of negative rank is visible as such to modifiers, a left negative rank L used with Table would be applied twice (once by the ranks added by Table, and once by the operand itself). This would result in the L-cells ''of each of the left argument's L-cells'' being paired ''1-to-1'' with the specified cells of the right argument—not a Cartesian pairing. If a J dialect both allowed externally visible negative rank and defined Table to instead be <syntaxhighlight lang=j inline>u"lu _"_ ru</syntaxhighlight>, one could express e.g. the Cartesian pairing of the [[major cells]] of the left and right arguments as <syntaxhighlight lang=j inline>u"_1/</syntaxhighlight>.
Given the <syntaxhighlight lang=j inline>u"(lu, _)</syntaxhighlight> definition of Table, even in a hypothetical J dialect in which assignment of negative rank is visible as such to modifiers, a left negative rank L used with Table would be applied twice (once by the ranks added by Table, and once by the operand itself). This would result in the L-cells ''of each of the left argument's L-cells'' being paired ''1-to-1'' with the specified cells of the right argument—not a Cartesian pairing. If a J dialect both allowed externally visible negative rank and defined Table to instead be <syntaxhighlight lang=j inline>u"lu _"_ ru</syntaxhighlight>, one could express e.g. the Cartesian pairing of the [[major cells]] of the left and right arguments as <syntaxhighlight lang=j inline>u"_1/</syntaxhighlight>.


trusted
83

edits

Navigation menu