arnd.baecker at web.de
Fri Nov 19 05:05:21 CST 2004
On Fri, 19 Nov 2004, Pearu Peterson wrote:
> 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 : type(scipy.linalg.flapack.zgesv)==type(scipy.linalg.clapack.zgetri)
> > Out: False
> That's interesting:
> In : type(scipy.linalg.flapack.zgesv),
> Out: (<type 'fortran'>, <type 'fortran'>)
> In : type(scipy.linalg.flapack.zgesv) is
> Out: 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'>"
Many thanks Pearu - this of course much better, more robust
and shorter than the stuff I used before.
This allowed to shorten the whole checks substantially
(updated version on the web).
More information about the Scipy-dev