[Numpy-discussion] lapack_lite dgesv

Tim Hochberg tim.hochberg at ieee.org
Mon Dec 11 07:48:55 CST 2006


R. David wrote:
> Hello Tim,
>   
>> 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.
>>     
>
> I tried both notations and none work.
>
> In the meantime, I tried extending the ipiv arrays to a 2 dimensionnal
> ones (if I had more than on right member for instante), but I still
> get the error message.
>
>   
Romaric,

Try replacing 'int' with intc (or numpy.intc if you are not using 
'import *'). The following 'works' for me in the sense that it doesn't 
throw any errors (although I imagine the results are nonsense):

        from numpy import *
        nbrows, nbcols = 10, 10
        a=zeros([nbrows,nbcols],float,order='C')
        b = zeros([nbcols], float, order='C')
        DIM = nbrows
        info = 0
        ipiv=zeros([DIM],intc,order='C')
        linalg.lapack_lite.dgesv(DIM,1,a,DIM,ipiv,b,DIM,info)


[In the future, could you could you try including self contained 
examples, so others don't have to go back and figure out sensible values 
for DIMS and info and whatnot? Ideally we'd just be able to throw them 
into a file and run them and get the same error that you are getting]

Hope that solves it.

-tim




More information about the Numpy-discussion mailing list