Gee, dissect works for me. But about all it shows is what input cells
go into a result cell. Repeated clicks on the result take you deeper
into the rank nesting.
The overall idea of kr2 is, 'Get the result atoms in the right order,
then reshape to an array'. The part on the right gets the result atoms
into the right order.
And what is that order? Look at a Kronecker product, and you see that
the first row is the first row of b multiplied by the atoms of the first
row of a in turn; the second row is the second row of b times the atoms
of the first row of a in turn... etc until b is exhausted, creating an
'a-group'; then repeat with the second row of a times rows of b...
repeat till a is exhausted.
The expression *"0 1"1"1 2 thus is
x V1 " 1 2 y where x and y are tables
apply V1 on each row of x against all of y
x V2 " 1 y where x is a row and y is a table
apply V2 repeatedly on successive rows of y, with x staying constant
x * "0 1 y where x and y are rows
create the multiplication table of x and y: one row of result for each
atom of x
The innermost operation creates one row of the final result (after
reshaping).
The middle operation creates one a-group;
The outer operation creates all the a-groups.
And yes, I'm proud of it. Somehow rank obviates the need for transpose
or other reordering.
Henry Rich
On 10/15/2017 9:57 PM, Brian Schott wrote:
Henry,
I've been hoping someone else would ask about or clarify your kr2 answer,
but since no one has I have to ask, how the right tine of kr2 works when
almost no part of it works, but the whole does work? Below are my
experiments that produce length errors as well as the whole which you used.
Btw, I tried looking at it with dissect but that did not help.
When I finally ran "trace'a (*"0 1"1"1 2) b'" I may have gotten a hint at
something different when the last step was parsed by "5 trident" and not "2
dyad". But that still has me lost.
$a *"1"1 2 b
|length error
| $a *"1"1 2 b
$a *"1 2 b
|length error
| $a *"1 2 b
$a *"0 1"1"1 2 b
2 3 2 3
$a *"0 1"1 b
|length error
| $a *"0 1"1 b
$a *"0 1 b
|length error
| $a *"0 1 b
---
This email has been checked for viruses by AVG.
http://www.avg.com
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm