I was commenting on the "(I still don't get . )" quip. Thanks,
-- Raul On Sat, Jul 25, 2015 at 4:30 PM, Mike Day <[email protected]> wrote: > Thanks, Raul, but who/what were you commenting to/on? > > Cheers, > > Mike > > > > On 25/07/2015 20:11, Raul Miller wrote: >> >> 1 0 1 +/ .* 10 100 1000 >> 1010 >> >> The dot product is arguably a key feature of J. This allows you to >> multiply matrices: >> >> 1+i.2 3 >> 1 2 3 >> 4 5 6 >> 7+i.3 2 >> 7 8 >> 9 10 >> 11 12 >> (7+i.3 2)+/ .*1+i.2 3 >> 39 54 69 >> 49 68 87 >> 59 82 105 >> >> Note also that you can often use %. to go the other way: >> >> ((7+i.3 2)+/ .*1+i.2 3)%.7+i.3 2 >> 1 2 3 >> 4 5 6 >> >> But let's save that issue for later... >> >> Anyways, what . does is pair up the last dimension of the argument on >> the left with the first dimension of the argument on the right - >> combining things with the verb on the right and then applying the verb >> on the left to that. >> >> For example: >> 7 8 +/ .* 1+i.2 3 >> 39 54 69 >> 7 8 * 1+i.2 3 >> 7 14 21 >> 32 40 48 >> +/7 8 * 1+i.2 3 >> 39 54 69 >> >> And we can do the same thing with the other rows of 7+i.3 2: >> +/9 10 * 1+i.2 3 >> 49 68 87 >> +/11 12 * 1+i.2 3 >> 59 82 105 >> >> And you can see all of these in the result: >> (7+i.3 2)+/ .*1+i.2 3 >> 39 54 69 >> 49 68 87 >> 59 82 105 >> >> Other operations are also possible. For example we can detect >> collisions between binary lists using *. >> >> 0 1 0 1 *. 0 0 1 1 >> 0 0 0 1 >> >> Or, of course, we could do exactly the same thing with * >> >> 0 1 0 1 * 0 0 1 1 >> 0 0 0 1 >> >> And we can check if there were any collisions using +./ >> +./ 0 1 0 1 * 0 0 1 1 >> 1 >> >> So basically, it's just: >> dot=:2 :'u@(v"1 _)' >> >> And u is usually formed using the / adverb. >> >> I hope this helps, but I suspect I'm not doing a very good job of >> describing the process. >> >> Oh well... >> > > > --- > This email has been checked for viruses by Avast antivirus software. > https://www.avast.com/antivirus > > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
