I agree completely about +/ .* . With work expected on numerics, it would be a bad idea to proliferate special cases. (I had said I would vote against that).
But Mark also netioned improving %., which was what I was thinking of approvingly. I had the idea that, depending on the implementation, the test might not require much code. After looking at some reference books I no longer believe this. Henry Rich > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Roger Hui > Sent: Saturday, September 02, 2006 5:40 PM > To: Programming forum > Subject: Re: RE: [Jprogramming] Re: Symmetric inner and outer products > > So we agree that the important consideration is > whether the special code is worthwhile, not that > the checking can be done in O(n^2) time. > > For the checking and for the special code for > symmetric matrices, you get a speed-up by a factor > which is at most 2. The code for +/ .* would be at > least doubled in size, which means when it comes > time to have really special code, exploiting SSE or > multi core or whatever, the amount of code to be > changed is doubled. > > On the other hand, consider putting effort into > improving +/ .* on sparse matrices. There, the > speed-up can be from O(n^3) to O(n^2), and the > factor can be as large as you like. You can do > products on matrices whose dense representations > wouldn't even fit in 32-bit space. > > > > ----- Original Message ----- > From: Henry Rich <[EMAIL PROTECTED]> > Date: Saturday, September 2, 2006 11:45 am > Subject: RE: [Jprogramming] Re: Symmetric inner and outer products > > > The checking for identity is only O(n^2) if the result is > > true - usually it's O(1) approximately. > > > > The question is, is it worth the coding effort? Symmetric > > matrices are so common - more likely than not, in my work - > > that Mark's suggestion has merit. > > > ---------------------------------------------------------------------- > For information about J forums see > http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
