# [SciPy-dev] linalg.flapack strange argument in *gesdd

Arnd Baecker arnd.baecker at web.de
Wed May 18 03:46:09 CDT 2005

```
On Wed, 18 May 2005, Nils Wagner wrote:

> Hi all,
>
> A help (linalg.flpack) yields
>
> This module 'flapack' is auto-generated with f2py (version:2.46.243_1985)
>
> u,s,vt,info =
> sgesdd(a,compute_uv=1,lwork=(compute_uv?4*minmn*minmn+MAX(m,n)+9*minmn:MAX(14*minmn+4,10*minmn+2+25*(25+8))+MAX(m,n)),overwrite_a=0)
>       u,s,vt,info =
> dgesdd(a,compute_uv=1,lwork=(compute_uv?4*minmn*minmn+MAX(m,n)+9*minmn:MAX(14*minmn+4,10*minmn+2+25*(25+8))+MAX(m,n)),overwrite_a=0)
>       u,s,vt,info =
> cgesdd(a,compute_uv=1,lwork=(compute_uv?2*minmn*minmn+MAX(m,n)+2*minmn:2*minmn+MAX(m,n)),overwrite_a=0)
>       u,s,vt,info =
> zgesdd(a,compute_uv=1,lwork=(compute_uv?2*minmn*minmn+MAX(m,n)+2*minmn:2*minmn+MAX(m,n)),overwrite_a=0)
>
> What is the meaning of compute_uv?4*minmn*minmn ?

The "?" is the ternary operator.
In this case it means: if compute_uv is 1 (the default),
then define lwork as 4*minmn*minmn+MAX(m,n)+9*minmn
if not: take the other value written after the ":".

If everything works fine you should not bother
about setting lwork manually.
To really understand all this you will have to
look at the documentation for sgesdd via `man sgesdd`
(assuming the lapack man-pages are installed properly),
or have a look at
http://www.netlib.org/lapack/single/sgesdd.f

BTW: I think it would be great if the information available
at the above link or via `man sgesdd`
was accessible from within (I)python via the interactive help.

Best,

Arnd

```