[Scipy-tickets] [SciPy] #1119: arpack.eigen checks for dtype which does not exist for LinearOperator instances

SciPy Trac scipy-tickets@scipy....
Wed Feb 17 10:26:55 CST 2010


#1119: arpack.eigen checks for dtype which does not exist for LinearOperator
instances
---------------------------------+------------------------------------------
 Reporter:  barbey               |       Owner:  wnbell
     Type:  defect               |      Status:  new   
 Priority:  normal               |   Milestone:  0.8.0 
Component:  scipy.sparse.linalg  |     Version:  0.7.0 
 Keywords:                       |  
---------------------------------+------------------------------------------
 Despite what is explain in the eigen documentation, one cannot use eigen
 with a LinearOperator instance input.
 This is due to eigen checking dtype. For instance the following code :
 {{{
 import scipy
 from scipy.sparse.linalg.eigen.arpack import  eigen
 from scipy.sparse.linalg import LinearOperator
 fft_op = LinearOperator((16, 16), scipy.fft)
 w, v = eigen(fft_op, k=6)
 }}}

 returns :


 {{{
 ---------------------------------------------------------------------------
 AttributeError                            Traceback (most recent call
 last)

 /home/nbarbey/projets/lanczos/test.py in <module>()
 ----> 1
       2
       3
       4
       5

 /usr/lib/python2.6/dist-
 packages/scipy/sparse/linalg/eigen/arpack/arpack.pyc in eigen(A, k, M,
 sigma, which, v0, ncv, maxiter, tol, return_eigenvectors)
     134
     135     # guess type

 --> 136     typ = A.dtype.char
     137     if typ not in 'fdFD':
     138         raise ValueError("matrix type must be 'f', 'd', 'F', or
 'D'")

 AttributeError: LinearOperator instance has no attribute 'dtype'

 }}}

-- 
Ticket URL: <http://projects.scipy.org/scipy/ticket/1119>
SciPy <http://www.scipy.org>
SciPy is open-source software for mathematics, science, and engineering.


More information about the Scipy-tickets mailing list