[SciPy-dev] pynotes

Pearu Peterson pearu at scipy.org
Fri Nov 19 04:34:24 CST 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), 
Out[10]: (<type 'fortran'>, <type 'fortran'>)

In [11]: type(scipy.linalg.flapack.zgesv) is 
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'>"


More information about the Scipy-dev mailing list