Well.. hmm... Here's the heart of that k=n-1 expression:
(i.x)=/-~/~i.x) For example: (i.4)=/-~/~i.4 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 (As you can see, it's not incredibly efficient. It might make sense to transform one of those dimensions into index values to gain an order of magnitude in compactness. You do not have to worry much about index values all 0 rows because those get compressed out later. But the problem you would have to solve is: what do you replace the rightmost # operation with, when working with indices? It will probably be something like an index and ravel and then another transformation to get the partition control list. On the positive side, this should eliminate the need to subtrace/add the rows - which is how I am inserting non-zero values into the final rows with that # operation.) Anyways... In principle you could use a similar expression with a rank-4 bit array which a triangular plane slicing it in a similar fashion (or, ok, maybe map that to a rank 3 array of indices). But of course, you lose an additional order of magnitude in efficiency from the additional array rank - though sparse arrays might help here, depending on how the expressions work. But I've not thought up any good expressions for constructing that array. Thanks, -- Raul On Thu, Nov 23, 2017 at 3:45 AM, 'Mike Day' via Programming <[email protected]> wrote: > Wow - more than I could manage with my phone and phingers! > > Or desktop! > > So have we got closed forms for k=3, k=n-2? > > M > > > On 23/11/2017 02:49, Raul Miller wrote: >> >> Hmm... right - it corresponds to an upper (or lower) triangular matrix, >> not >> the identity matrix. So... >> >> (|.>:/~i.x)#&(,/)(i.x)+(1 j.(i.x)=/-~/~i.x)#"1"_1-~/~i.x >> >> In other words, once again, oops. (But at least, this time, I tested the >> expression. Though I know it could be refactored to be more concise-- but >> the phone UI is too clumsy for that...) >> >> Thanks, >> > > > --- > 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
