On Jan 23, 4:05 pm, Casey Hawthorne <[EMAIL PROTECTED]> wrote: > Do you calcalate the matrix inversion, when you don't need to? >
No, the inversion is only calculated on the first call to inverse(), and memoized so that subsequent calls return the cached value immediately. Since the Matrix class is mutable, the cache is invalidated if any of the matrix elements are updated. So after changing a matrix element, the inversion would be recalculated at the next call to inverse(). Hope that clears things up. You can also do your own experiments, including adding verbose logging to the memoizing decorators - an example is included in the source code. Also the footprint is quite small, just one Python source file, about 600-700 lines of code, and all Python, so 100% portable. -- Paul -- http://mail.python.org/mailman/listinfo/python-list