[SciPy-user] howto call lapack funcs from scipy?

Robert Kern robert.kern at gmail.com
Wed Oct 3 20:46:42 EDT 2007


dmitrey wrote:
> Hi all,
> does anyone know an URL to an obvious explanation of howto call lapack 
> funcs from scipy?
> For example, I tried to use cgelss routine but I didn't get to know how 
> to use the one - neither from scipy website (using search) nor from code:
> -------------------------------------
> import scipy
> from scipy.linalg.flapack import cgelss
> print help(cgelss)
> print dir(cgelss)

The help() function doesn't know anything about f2py wrapper functions like
cgelss, so it gives up. However, you can print cgelss.__doc__:

In [6]: from scipy.linalg.flapack import cgelss

In [7]: print cgelss.__doc__
cgelss - Function signature:
  v,x,s,rank,info = cgelss(a,b,[cond,lwork,overwrite_a,overwrite_b])
Required arguments:
  a : input rank-2 array('F') with bounds (m,n)
  b : input rank-2 array('F') with bounds (maxmn,nrhs)
Optional arguments:
  overwrite_a := 0 input int
  overwrite_b := 0 input int
  cond := -1.0 input float
  lwork := 2*minmn+MAX(maxmn,nrhs) input int
Return objects:
  v : rank-2 array('F') with bounds (m,n) and a storage
  x : rank-2 array('F') with bounds (maxmn,nrhs) and b storage
  s : rank-1 array('f') with bounds (minmn)
  rank : int
  info : int


-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
 that is made terrible by our own mad attempt to interpret it as though it had
 an underlying truth."
  -- Umberto Eco



More information about the SciPy-User mailing list