[Numpy-discussion] lapack_lite dgesv

Tim Hochberg tim.hochberg at ieee.org
Mon Dec 11 07:20:02 CST 2006


R. David wrote:
> Hello,
>
> I am trying to use the lapack_lite dgesv routine.
>
> The following sample code :
>
> from numpy import *
> [....]
> a=zeros((nbrows,nbcols),float,order='C')
> [....]
> ipiv=zeros((DIM),int,order='C')
> [....]
> linalg.lapack_lite.dgesv(DIM,1,a,DIM,asarray(ipiv),b,DIM,info)
>
> leads do the followin error message :
> lapack_lite.LapackError: Parameter ipiv is not of type PyArray_INT in lapack_lite.dgesv
>
> I don't understand the type problem for ipiv !
> Indeed, the type of 'a' is OK, ipiv is created the same way than a, but something goes
> wrong.
> Do you have a clue for this ?
>   
The problem is probably your definition of ipiv. "(DIM)" is just a 
parenthesized scalar, what you probably want is "(DIM,)", which is a 
one-tuple. Personally, I'd recommend using list notation ("[nbrows, 
nbcols]", "[DIM]") rather than tuple notation since it's both easier to 
read and and avoids this type of mistake.

Regards,

-tim



More information about the Numpy-discussion mailing list