I just noticed that you converted (4&$.)^:_1 to [EMAIL PROTECTED] somewhere along the line. That speaks well of your poetic sense. I shall be using it that way from now on.
Essentially, the following identity should hold: x -. 4 $. _4 $. x NB. I know there's a tacit in here. The margin's just too small. :-) ------------------------------------------------------------------------ |\/| Randy A MacDonald | APL: If you can say it, it's done.. (ram) |/\| [EMAIL PROTECTED] | |\ | | The only real problem with APL is that BSc(Math) UNBF'83 | it is "still ahead of its time." Sapere Aude | - Morten Kromberg Natural Born APL'er | Demo website: http://156.34.82.188/ -----------------------------------------------------(INTP)----{ gnat }- ----- Original Message ----- From: "Miller, Raul D" <[EMAIL PROTECTED]> To: "Programming forum" <[email protected]> Sent: Monday, February 05, 2007 12:27 PM Subject: RE: [Jprogramming] Spare Matrix from Index Matrix Randy A MacDonald wrote: > > That (4&$.)^:_1 does not return the original table is > > not important to me. Raul Miller wrote: > > That's not an inverse. Randy A MacDonald wrote: > Yes, in the same sense that useful applications of #^:_1 and > #.^:_1 are not inverses. I'm not sure what your point about #^:_1 is, but I'll grant that #.^:_1 #.v can have a different shape (and different elements) from v. Then again, I think the fact that #.^:_1 is not an inverse is balanced by the fact that it sees quite a bit of use. > > Useful for what? > > I haven't figured that out, but it looks similar to the # and #. cases. > > What's wrong with something like > > [EMAIL PROTECTED] [:(] #: i.@:>:)>./ > > ? > Give me a half-hour to decipher it (which some would say is the > problem) and I'll tell you. It's intended to produce the same values as you have been suggesting for _4&$. It does have some hypothetical flaws (for example, it computes a dense result and then converts that to sparse), but... whether or not those are actual flaws depends on how (and if) it gets used. Here's a simpler version of that, for the case where: y is the index matrix (which would be produced by $.4) s is the shape of the desired result matrix it's OK for the result to be dense (s #: i. s) e. y As I understand your proposal for _4&$., you would replace s with >./y and you would want to convert this result from a dense matrix to a sparse matrix. (Then again, one of the potential flaws here is that I might not understand what you want _4&$. to do...) > > Anyways... there's lots of different kinds of "useful". > > ... therefore I question the need for the scare quotes. The scare quotes were intended to convey that the meaning of the word could vary significantly with the context in which it was considered. I hope that helps. -- 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
