[SciPy-dev] pynotes

Pearu Peterson pearu at scipy.org
Fri Nov 19 05:34:24 EST 2004



On Fri, 19 Nov 2004, Arnd Baecker wrote:

> Is there a better way to get the type of routines
> in flapack (and clapack)?
> ((Note that the types of the routines in lapack and clapack which
> seem to be different:
> In [6]: type(scipy.linalg.flapack.zgesv)==type(scipy.linalg.clapack.zgetri)
> Out[6]: False

That's interesting:

In [10]: type(scipy.linalg.flapack.zgesv), 
type(scipy.linalg.clapack.zgetri)
Out[10]: (<type 'fortran'>, <type 'fortran'>)

In [11]: type(scipy.linalg.flapack.zgesv) is 
type(scipy.linalg.flapack.zgetri)
Out[11]: True

The reason why flapack and clapack (or of any other f2py generated 
extension module) fortran types are different is that each f2py
extension module implements its own fortran type. So, to check for a 
fortran type, you should probably use:

def isfortrantype(obj):
   return repr(type(obj))=="<type 'fortran'>"

Pearu




More information about the SciPy-Dev mailing list