On Tue, Sep 1, 2015 at 11:42 PM, Thomas McGuire <tmcguir...@gmail.com> wrote: > Thanks I will try out your changes. Though in my implementation I was trying > to avoid multiplying the zero entries and your routines ignore that.
Yep. It's slower to toss them than it is to just ignore them. Reason being that you're making a fresh copy of each row for each operation when you ignore those zeros. And the maximum speedup you could get would be a factor of 2 - so at best that cancels out. And, since inner product is so fast (adds and multiplies are really cheap and on modern cpus things are arranged so you get a few "free with every memory operation" - and if you don't use them you're essentially just wasting that part of your cpu's capabilities). Also there's overhead to each operation performed by the interpreter -- basically, it's better to just keep things simple. (Unless you are just modeling the code for something else. Then interpreter efficiency isn't relevant.) Good luck, -- Raul ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm