[SciPy-user] Wrapping geqp3 (Rank revealing QR)

Nils Wagner nwagner at mecha.uni-stuttgart.de
Fri Feb 24 09:19:17 CST 2006


Pearu Peterson wrote:
>On Fri, 24 Feb 2006, Nils Wagner wrote:
>
>  
>>Hi all,
>>
>>I was trying to wrap geqp3...(my homework as suggested by Arnd ;-) )
>>It turns out that it is not straightforward (at least for me).
>>
>>I have used an example taken from generic_flapack.pyf
>>    
>
>First, all addition to lapack wrapping should be commited to
>scipy/Lib/lib/lapack. Signatures for geqp3 should be added to
>flapack_llsc.pyf.src file in scipy/Lib/lib/lapack.
>
>
>  
>>Some observations:
>>The number of arguments differ wr.t. to complex (C,Z) and real matrices
>>(S,D).
>>How is this handled with scipy ?
>>
>>     SUBROUTINE CGEQP3( M, N, A, LDA, JPVT, TAU, WORK, LWORK, RWORK,
>>    $                   INFO )
>>     SUBROUTINE DGEQP3( M, N, A, LDA, JPVT, TAU, WORK, LWORK, INFO )
>>    
>
>
>See the first signature in flapack_esv.pyf.src that demonstrates how to
>deal with such a situation. Basically, you should use
>   <_1=,,rwork\,,\2>
>instead of
>   rwork,
>in the argument list of <prefix>geqp3. Check out also the corresponing 
>bits in callstatement, callprotoargument are handled in <prefix><sym>ev.
>
>
>HTH,
>Pearu
>
>_______________________________________________
>SciPy-user mailing list
>SciPy-user at scipy.net
>http://www.scipy.net/mailman/listinfo/scipy-user
>  

Pearu,

Thank you for your quick reply !

The next issues are

1. How do I handle JPVT ?

2. How do I find the size of LWORK in *geqp3 ?

I am willing to learn it :-)
but the contents of flapack_esv.pyf.src is somehow cryptic in many
places e.g.

     callstatement
if(irange_capi==Py_None);else{irange[0]++;irange[1]++;}(*f2py_func)((compute_v?"V":"N"),(vrange_capi==Py_None?(irange_capi==Py_None?"A":"I"):"V"),(lower?"L":"U"),&n,a,&n,vrange,vrange+1,irange,irange+1,&atol,&m,w,z,&ldz,isuppz,work,&lwork,<_2=,,rwork\,&lrwork\,,\2>iwork,&liwork,&info);if(irange_capi==Py_None);else{irange[0]--;irange[1]--;}if(vrange_capi==Py_None);else
{capi_w_tmp-\>dimensions[0]=capi_z_tmp-\>dimensions[1]=m;/*capi_z_tmp-\>strides[0]=m*capi_z_tmp-\>descr-\>elsize;*/}

Nils



More information about the SciPy-user mailing list