[SciPy-user] eigenvalues of sparse matrix

Pearu Peterson pearu at scipy.org
Fri Oct 29 10:56:22 CDT 2004



On Thu, 28 Oct 2004, Travis Oliphant wrote:

>> I looked into ARPACK API and I think f2py could be effectively used to wrap
>> ARPACK. For example, when considering SIMPLE/dssimp.f case then
>> I would write a Fortran subroutine that contains dsaupd main-loop and call 
>> to dseupd (the subroutine av would be provided as a callback argument) and 
>> then wrap this subroutine with f2py.
>
> My suggestion is to do something very similar as is done in 
> scipy/linalg/iterative.py   wherein the object passed to the Python-level 
> code simply requires a matvec method (like all sparse arrays have), or is a 
> normal 2-d array.  Then, call python-wrapped dsaupd in a while loop which 
> does the required thing after returning from every dsaupd call. 
> This is the most flexible interface and deserves a place in scipy.
>
> Pearu's suggestion is also useful and may be a bit faster (though I'm not 
> sure it would be noticeably faster).

My suggestion was not to make things faster (though it might turn out to 
be slightly so) but more robustly to share common data between dsaupd and 
dseupd calls: the second part of dseupd arguments should be exactly the 
same as dsaupd plus the input arguments determining the task must be the 
same. Though wrapping both dsaupd and dseupd to Python gives more 
flexibilty but I am not sure that will be ever needed nor would avoid 
incorrect usage of the ARPACK wrappers.

Just my 2 Estonian cents,
Pearu



More information about the SciPy-user mailing list