This example shows that restart command does not work correctly - it means that it does not clear stack memory(internal memory). The following example shows it. In that procedure there are some mistakes, but I think that the restart command should work correctly whith them. If you execute the following procedure three times (maybe twice, it depends on the computer memory capacity, but I do not amount to more than three times), the Maple system falls down with out of memory (execution stop - the stack ) - why? You call the restart command, so where the fatal error is. It does not depend on the correct usage of statements in the procedure. > restart: stx:=time(): > > Digits :=15: > > test2:=proc(N,n) > local i,a,xbar,s,R,X; > > # the following 3 statements are not correct > s:=Vector[1..N]; > R:=Vector[1..N]; > xbar:=Vector[1..N]; > > use Statistics in > X := RandomVariable(Normal(0,1)): > for i from 1 to N do > a:=Sample(X,n): > xbar[i]:=Mean(a): > s[i]:=StandardDeviation(a): > R[i]:=Range(a): > end do: > end use; > printf(" time: %8.2f second \n",time()-stx); > end proc: > test2(10000,10); Does restart do what we expect? Thank you. Vladimir

Please Wait...