Python linear algebra module -- requesting comments on interface

Colin J. Williams cjw at sympatico.ca
Fri Sep 9 12:50:13 EDT 2005


Connelly,

Apologies, my first message was sent in error.

I like your general setup.  You appear to permit matrix operations, 
which the folk at Numeric and, later, numarray did not.

My own package, PyMatrix, has similar aims to yours but it may be slower 
as it is based on numarray.

My package is just about ready for another release but I'm toiling to 
improve the documentation.  I felt that it could be of value to 
newcomers to matrices and so my new documentation is more long-winded 
than yours.  Your overview sets the whole thing out very neatly.

I have made use of Python's properties for transpose, inverse etc.  This 
uses abbreviations and avoids redundant parentheses.

My work was based on the ideas of Huaiyu Zhu, who developed MatPy:
http://matpy.sourceforge.net/

You might be interested in looking at PyMatrix: 
http://www3.sympatico.ca/cjw/PyMatrix/

Best wishes,

Colin W.

C. Barnes wrote:
> Hi, I'm in the process of writing a Python linear
> algebra module.
> 
> The current targeted interface is:
> 
>   http://oregonstate.edu/~barnesc/temp/linalg/
> 
> The interface was originally based on Raymond
> Hettinger's
> Matfunc [1].  However, it has evolved so that now it
> is
> nearly identical to JAMA [2], the Java matrix library.
> 
> I am soliticing comments on this interface.
> 
> Please post up any criticism that you have.  Even
> small
> things -- if something isn't right, it's better to fix
> it now than later.
> 
> I have not made source code available yet, since the
> current code is missing the decompositions and doesn't
> match the new interface.  I'm in the process of
> rewritting the code to match the new interface.  You
> can e-mail me and ask for the old code if you're
> curious
> or skeptical.
> 
> [1]. http://users.rcn.com/python/download/python.htm
> [2]. http://math.nist.gov/javanumerics/jama/
> 
> ---------------------------------------------
> Brief comparison with Numeric
> ---------------------------------------------
> 
> Numeric and linalg serve different purposes.
> 
> Numeric is intended to be a general purpose array
> extension.  It takes a "kitchen sink" approach,
> and includes every function which could potentially
> be useful for array manipulations.
> 
> Linalg is intended to handle real/complex vectors
> and matrices, for scientific and 3D applications.
> It has a more restricted scope.  Because it is
> intended for 3D applications, it is optimized
> for dimension 2, 3, 4 operations.
> 
> For the typical matrix operations, the linalg
> interface is much intuitive than Numeric's.  Real
> and imaginary components are always cast to
> doubles, so no headaches are created if a matrix
> is instantiated from a list of integers.  Unlike
> Numeric, the * operator performs matrix
> multiplication, A**-1 computes the matrix inverse,
> A == B returns True or False, and the 2-norm and
> cross product functions exist.
> 
> As previously stated, linalg is optimized for
> matrix arithmetic with small matrices (size 2, 3, 4).
> 
> A (somewhat out of date) set of microbenchmarks [3]
> [4]
> show that linalg is roughly an order of magnitude
> faster than Numeric for dimension 3 vectors and
> matrices.
> 
> [3].
> Microbenchmarks without psyco:
> http://oregonstate.edu/~barnesc/temp/
> numeric_vs_linalg_prelim-2005-09-07.pdf
> 
> [4].
> Microbenchmarks with psyco:
> http://oregonstate.edu/~barnesc/temp/
> numeric_vs_linalg_prelim_psyco-2005-09-07.pdf
> 
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around 
> http://mail.yahoo.com 



More information about the Python-list mailing list