A factor of 2 isn't exciting for most parts of the interpreter, because most bits get executed very little.
Matrix inverse and matrix multiplication, on the other hand, can be the dominant part of a computation, maybe taking hours to run. A factor of 2 there would be worth getting. (I would roll out the appropriate quote from _Numerical Recipes_ but last time I did that Roger called it a 'cheap shot' :) ). Generating a symmetric matrix is just the first step. Then you have to use the matrix. Saving time on the O(n^2) generation is nugatory if you have to spend O(n^3) time on subsequent multiplications. So, perhaps a Fit on +/ .* could say that the matrices are symmetric, or something like that. A 128!: could calculate the inverse of a symmetric matrix. I would cast my vote against doing any of this. More important is to make the interpreter use multiple cores. For arithmetic operations in general, it would also be a much better use of coding time to take advantage of the SSE3 instructions. With careful coding there could be a severalfold increase in speed for +/ .* and a noticeable improvement for other floating-point arithmetics. Henry Rich > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Roger Hui > Sent: Thursday, August 31, 2006 12:12 AM > To: Programming forum > Subject: Re: [Jprogramming] Symmetric inner and outer products > > - A factor of 2 isn't very exciting. Scan the > factors quoted in the release notes: > http://www.jsoftware.com/books/help/release/contents.htm > > - Special code is more likely for an expression > which is tacit and is the simplest possible. > For example: fn"1/~ and (f . g |:) > > > > ----- Original Message ----- > From: Fraser Jackson <[EMAIL PROTECTED]> > Date: Wednesday, August 30, 2006 8:38 pm > Subject: [Jprogramming] Symmetric inner and outer products > > > There are many problems where for a matrix a either the following > > > > a fn"1 1 / a > > > > or > > > > > > a f . g |: a > > > > generate a symmetric matrix. > > > > > > I could well do with the saving of half the time on a computation. > > > > 1. Has anyone good suggestions for handling this? > > 2. Isn't this such a common problem that some way of telling > > the > > interpreter to only do one triangle should be constructed? > > > ---------------------------------------------------------------------- > For information about J forums see > http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
