[PYTHON MATRIX-SIG] LAPACK module questions

Doug Heisterkamp drh@oasis.unl.edu
Tue, 13 Feb 1996 10:49:41 -0600 (CST)


Hi,

I have completed a first pass at a C module to access the LAPACK library.  I
have a few questions as I move on an try to refine it.  But first, what I've
done is to write a parser that reads the source code from CLAPACK and writes
an access call for each function.  The name and parameters are the same as in
the library with the exception of using the array object for matrices and
vectors.

And now the questions.

What is the proper way to access the data of an array object?  I did not pay
attention to the abstract object interface discussion on the main group and
am not sure how to do it through that interface.  Currently I'm just directly
accessing it such as (for a double a from array b)

a=(double *)((PyArrayObject *)PyArray_ContiguousFromObject(b,PyArray_DOUBLE,
      1,0))->data;

How should I package this C module with a python module?  Should it become
a subclass of Matrix or UserArray?  Should it be a module with just a bunch
of functions in it?

Are there other people working on accessing math libraries?  It would be nice
if we could set up some conventions on function names, calling parameters, 
and exceptions for some of the common items.  That way code that needs, say
eigenvalues, could import whichever math library that is on the machine and
still use a standard call to get the eigenvectors and values of a matrix.

I'm planning on writing a python wrapper for eigenvectors, determinants,
and svd.  What other functions are commonly used and would be nice to
have a clean interface to (as compared to the fortran interface of the
lapack library)?

If people are interested in the module, I could place it on an ftp server
somewhere.  It currently uses libraries built from CLapack which are just
the f2c conversion of the original fortran source.  Elf binaries of the
lapack and blas libraries are available at the linux sites (if you need
the directory, email me.  I have the location written down elsewhere).  The
source for lapack, clapack, and f2c are available from netlib.att.com.

Doug Heisterkamp
drh@oasis.unl.edu


=================
MATRIX-SIG  - SIG on Matrix Math for Python

send messages to: matrix-sig@python.org
administrivia to: matrix-sig-request@python.org
=================