(08/26/2009, 10:26 PM)bo198214 Wrote: The matrix application seems a bit obfuscated to me. Is there any reason why you dont do...Well, I've run into problems with creating matrices and vectors from lists, especially long lists. I've seen code take minutes with lists that takes only seconds if explicitly set with for loops. The problem only pops up in certain circumstances, but I've been bitten by performance issues enough times that I just start making everything explicit, just to be sure. There are a few circumstances where the implicit method is faster, but I usually start with implicit code to make sure my methods are sound, then explicit code for speed, and then if I have time, I try to see where I can sneak some implicit code back in for even more speed (or memory savings).
Also, the explicit code is definitely more memory-friendly in most cases, and when I try to push these methods to their limits, memory-friendly code is a must.
Update:
(08/26/2009, 10:26 PM)bo198214 Wrote: Btw. the code is now fast. Thanks Jay.
Yes, your version is even faster, more than twice as fast as mine (half as many multiply-adds during the power series multiplication)!
~ Jay Daniel Fox

