https://gist.github.com/chrispsn/af6844b80687462814fc39d4b97399a6

may be of interest

On Wed, 13 Jul 2022, Raul Miller wrote:

On Wed, Jul 13, 2022 at 4:23 AM Razetime <rraghu.11...@gmail.com> wrote:
The ngn/k version is much better for the K array model, and it's intended
as a nice and short description of the algorithm for nested lists.

Oh... yes... K is highly optimized for nested rank 1 lists of rank 1
lists -- J... not so much. J's rank winds up being mostly unnecessary
overhead when emulating K's data structures.

Still, if you wanted to represent matrices that way, here would be a
way of implementing matrix multiplication on nested lists in J (not
the part in parenthesis -- that could use some more work to approach
"k-like notation" -- but that's just the starting matrices):

  +/@:>L:1 (<"1]1+i.4 3) *&.> L:0 1 (<"1]1+i.3 4)
+-----------+-------------+---------------+---------------+
|38 44 50 56|83 98 113 128|128 152 176 200|173 206 239 272|
+-----------+-------------+---------------+---------------+

It's a bit awkward, but hopefully not too distant from the K notation?
(If I understand correctly, K's * gives the effect of J's *&.> for the
sort of context illustrated here?).

Thanks,

--
Raul
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to