![](https://secure.gravatar.com/avatar/e9718c61e5f3da247f137d3bf463bf2b.jpg?s=120&d=mm&r=g)
I've made a Numeric Python binding of the ARPACK library. ARPACK is a collection of Fortran77 subroutines designed to solve large scale eigenvalue problems, available at http://www.caam.rice.edu/software/ARPACK/ . These bindings have the following features: - Correspondence for all ARPACK calls - In place operation for all matrices - Easy access to ARPACK debugging control variables - Online help for all calls, with the correct Python/C 0-based indexing (automatically converted from the sources with the aid of a sed script). - Include ports of [unfortunately not all] original examples These bindings weren't generated with any automatic binding generation tool. Even though I initially tried both PyFortran and f2py, both showed to be inappropriate to handle the specificity of the ARPACK API. ARPACK uses a 'reverse communication interface' where basically the API sucessively returns to caller which must take some update steps, and re-call the API with most arguments untouched. The intelligent (and silent) argument conversions made by the above tools made very difficult to implement and debug the most simple example. Also, for large-scale problems we wouldn't want any kind of array conversion/transposing happening behind the scenes as that would completely kill performance. The source is available at http://jrfonseca.dyndns.org/work/phd/python/modules/arpack/dist/arpack-1.0.t... . The ARPACK library is not included and must be obtained and compiled seperately, and setup.py must be modified to reflect your system BLAS/LAPACK library. The bindings are API-centric. Nevertheless a Python wrapper to these calls can easily be made, where all kind of type conversions and dummy-safe actions can be made. I have done one myselve for a Sparse matrix eigenvalue determination using UMFPACK for sparse matrix factorization (for which a simple binding - just for double precision matrices - is available at http://jrfonseca.dyndns.org/work/phd/python/modules/umfpack/ ). I hope you find this interesting. Regards, José Fonseca __________________________________________________ Do You Yahoo!? Everything you'll ever need on one web page from News and Sport to Email and Music Charts http://uk.my.yahoo.com
![](https://secure.gravatar.com/avatar/e9718c61e5f3da247f137d3bf463bf2b.jpg?s=120&d=mm&r=g)
On Fri, Nov 22, 2002 at 01:33:08PM +0000, José Fonseca wrote:
The source is available at http://jrfonseca.dyndns.org/work/phd/python/modules/arpack/dist/arpack-1.0.t... . The ARPACK library is not included and must be obtained and compiled seperately, and setup.py must be modified to reflect your system BLAS/LAPACK library.
Two header files, arpack.h and arpackmodule.h, were missing from the above package. This has been corrected now. Thanks to Greg Whittier for pointing that out. A little more detailed install instructions are were also added. I'm also considering where I should bundle or not ARPACK in the source package, and then use scipy_distutils to compile the fortran source files. This would make much easier to install, but I'm personally against statically link libraries, as they inevitable lead to code duplication in memory. For example, while I don't manage to build a shared version, the ATLAS and LAPACK libraries appear both triplicated in on my programs - from Numeric, ARPACK and UMFPACK. This leads to a huge code bloat and a misuse of the processor code cache resulting in a lower performance. What is the opinion of the other subscribers regarding this? José Fonseca __________________________________________________ Do You Yahoo!? Everything you'll ever need on one web page from News and Sport to Email and Music Charts http://uk.my.yahoo.com
participants (2)
-
José Fonseca
-
Konrad Hinsen