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
