Patrick,
Thanks for your message.
I agree that your mp and mp2 give different results.
In J504 they give the SAME result, the same as +/ . * as expected.
I believe something must have changed btween j504 and J601.
What this change might be, I don't know. The release notes for J601 show
that
f/@:g has been improved.
Regards
Roger Stokes.
----- Original Message -----
From: "Patrick van Beek" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Saturday, June 14, 2008 4:27 AM
Subject: [Jprogramming] LJ 22.4.4 Matrix Product
22.4.4 of learning J has an equivalent definition of u @ (v " (1+L, _))
being (u @: v) " (1+L, _)
It then goes on to say
+/.* means (+/ @: *)" 1 _
I get different answers for these two phrases:
a=. >1 0 2; _1 3 1
b=. >3 1; 2 1;1 0
a +/ . * b
5 1
4 2
mp =. (+/ @: *)" 1 _
mp2 =. +/ @ (* " 1 _)
a mp b
7 3
4 2
a mp2 b
5 1
4 2
I came of with the following explicit definition though I could not quite
see why mp2 is equivalent since I had to change the rank of the insert.
+/"_1(a *"1 _ b)
5 1
4 2
I could not derive the result of mp explicitly. Could someone explain how
the result for a mp b is derived and so help me understand what mp is
doing
different to mp2?
Thanks,
Patrick
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm