Subject: Crashing in maxima 5.13.0 on Debian amd64
From: dlakelan
Date: Sat, 22 Dec 2007 17:50:59 -0800
I am playing around with my simulated annealing code and getting a
highly reproducible crash on my machine when I execute the following
code. The simulation runs for a while and then hangs. Maxima uses up 700
MB of virtual memory or so and then pegs the CPU. I don't see where
i'm initiating an infinite loop or anything. and if I use a smaller
number of iterations, i don't get the hang....
This is the stock Debian 5.13.0-2 (slightly older package than current
debian unstable which is 5.13.0-3 the dash numbers are the version of
the package. )
Can anyone confirm this hang on another machine?
---code below---
kill(all);
load("distrib");
minimize_sa(funname,vars,init,scales,maxiters,t0) :=
block([curval:ev(funname,map("=",vars,init)),
bestval:0,
bestpos:init, curpos:init, temp:t0,
tempfactor:1/100^(1/maxiters)
],
bestval:curval,
for i:1 thru maxiters do
block([nextval:curval,
nextpos:curpos +
map(random_normal,makelist(0,i,1,length(vars)),scales),
randnum:random(1.0)],
(nextval:ev(funname,map("=",vars,nextpos)),
print(nextval, " at ",nextpos),
if(nextval < curval or randnum < exp(-(nextval-curval)/temp))
then
(curpos:nextpos, curval:nextval,
if(nextval < bestval) then
(bestpos:nextpos,bestval:nextval)),
temp:temp*tempfactor)),
map("=",vars,bestpos));
minimize_sa(x^2+y^2,[x,y],[1,3],[.2,.2],200,1);