[SciPy-dev] St9bad_alloc
Maik Trömel
mtroemel81@web...
Thu Jun 21 01:55:47 CDT 2007
I tried it out at another system and I get the same error.
Probably there is memory leak in the delaunay-package. Or does anybody else have an idea what the problem could be?
Here is an example script (with sub-matrixes) which crashes:
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(1,10))
nwyx = indices((2600, 2548))
tri = Triangulation(index_y, index_x)
interp = tri.nn_interpolator(value)
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, 1300:2548] = interp(nwyx[0][0:1300, 1300:2548], nwyx[1][0:1300, 1300:2548])
nwwert[1300:2600, 0:1300] = interp(nwyx[0][1300:2600, 0:1300], nwyx[1][1300:2600, 0:1300])
nwwert[1300:2600, 1300:2548] = interp(nwyx[0][1300:2600, 1300:2548], nwyx[1][1300:2600, 1300:2548])
nwwert = where(nwwert == nwwert, nwwert, 0)
print nwwert.max()
Greetings Maik
> -----Ursprüngliche Nachricht-----
> Von: SciPy Developers List <scipy-dev@scipy.org>
> Gesendet: 18.06.07 15:53:16
> An: SciPy Developers List <scipy-dev@scipy.org>
> Betreff: Re: [SciPy-dev] St9bad_alloc
>
> Every point out of a convex hull arround the input data points gets the value nan.
> Try nwwert.max() . Do you get a result?
>
> Maik
>
>
> >
> > 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
> >
> >
> >
> > <hr>
> > _______________________________________________
> > Scipy-dev mailing list
> > Scipy-dev@scipy.org
> > http://projects.scipy.org/mailman/listinfo/scipy-dev
> >
> >
>
>
> __________________________________________________________________________
> Erweitern Sie FreeMail zu einem noch leistungsstärkeren E-Mail-Postfach!
> Mehr Infos unter http://produkte.web.de/club/?mc=021131
>
> _______________________________________________
> 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
More information about the Scipy-dev
mailing list