[SciPy-dev] St9bad_alloc

Nils Wagner nwagner@iam.uni-stuttgart...
Mon Jun 18 08:43:02 CDT 2007


Maik Trömel wrote:
> Here is a small example:
>
> ################################
>    from numpy import *
>    from scipy import *
>    from numpy.random import *
>    from scipy.sandbox.delaunay import *
>
>    index_y= [] 
>    index_x = [] 
>    value = []
>    for i in range(200):
>       index_y.append(randint(10,2500))
>       index_x.append(randint(10,2500))
>       value.append(randint(-10,10))  
>    
>    nwyx = indices((2600, 2548))
>    tri = Triangulation(index_y, index_x)
>    interp = tri.nn_interpolator(value)
>    nwwert = interp(nwyx[0], nwyx[1])
>
>    print  nwwert
> ################################
>
>
> If i split the funktion "interp()" into four sub-matrizes like  
> ################################
> nwwert = zeros((2600, 2548))
> nwwert[0:1300, 0:1300] = interp(nwyx[0][0:1300, 0:1300], nwyx[1][0:1300, 0:1300])) 
> nwwert[0:1300, 0:2548] = interp(nwyx[0][0:1300, 0:2548], nwyx[1][0:1300, 0:2548]))
> ... 
> ################################
> the script crashes always at the same sub-matrix. Regardless in which order I process the sub-matrixes.
>
> Maik
>
>   
>> Maik Trömel wrote:
>>     
>>> Hello List,
>>>
>>> I've got some problems with Scipy/sandbox/delaunay.
>>> Everytime I run my script the following error occures:
>>> terminate called after throwing an instance of 'std::bad_alloc'
>>>   what():  St9bad_alloc
>>>
>>> Does anybody know what this means? And what I can do to avoid this error?
>>>
>>>       
>> This means that dynamic allocation failed in some of the C++ code for 
>> delaunay.
>>     
>>> I have postet in several forums, but nowbody could help me.
>>>       
>> Well, we would need more details: can you reproduce the problem on a 
>> small, self contained example ?
>>
>> David
>> _______________________________________________
>> Scipy-dev mailing list
>> Scipy-dev@scipy.org
>> http://projects.scipy.org/mailman/listinfo/scipy-dev
>>
>>     
>
>
> _____________________________________________________________________
> Der WEB.DE SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
> http://smartsurfer.web.de/?mc=100071&distributionid=000000000066
>
> _______________________________________________
> Scipy-dev mailing list
> Scipy-dev@scipy.org
> http://projects.scipy.org/mailman/listinfo/scipy-dev
>   

I cannot reproduce the crash but
python -i delaunay.py
[[                           nan                            nan
                             nan ...,                            nan
                             nan                            nan]
 [                           nan                            nan
                             nan ...,                            nan
                             nan                            nan]
 [                           nan                            nan
                             nan ...,                            nan
                             nan                            nan]
 ...,
 [                           nan                            nan
                             nan ...,                            nan
                             nan                            nan]
 [                           nan                            nan
                             nan ...,                            nan
                             nan                            nan]
 [                           nan                            nan
                             nan ...,                            nan
                             nan                            nan]]

Nils

-------------- next part --------------
A non-text attachment was scrubbed...
Name: delaunay.py
Type: text/x-python
Size: 436 bytes
Desc: not available
Url : http://projects.scipy.org/pipermail/scipy-dev/attachments/20070618/3fd1544d/attachment.py 


More information about the Scipy-dev mailing list