Re: Arbitrary Crash with Compile

*To*: mathgroup at smc.vnet.net*Subject*: [mg36600] Re: Arbitrary Crash with Compile*From*: Wizard Lab <noemail at ucr.edu>*Date*: Fri, 13 Sep 2002 01:14:45 -0400 (EDT)*Organization*: University of California, Riverside*References*: <alev2a$5dm$1@smc.vnet.net>*Sender*: owner-wri-mathgroup at wolfram.com

Jens-Peer Kuska tells me that he gets no crash with Mathematica 4.2, however after working with this program for more than a month, trying every possible permutation and manipulation, and having it still crash, I am still worried that upgrading to 4.2 won't solve my problem. Can anyone else with 4.2 try running this program for me a good number of times, say 3 or 4, and see if they get similar good results? Regards, Bernard Gress Wizard Lab wrote: Dear Group, I have a program to take the local polynomial non parametric regression of two variables. It uses Compile, unfortunately, and regularly, but inconsistently, causes Mathematica to crash (in Win2K, with I forget what error, and in Win98/Mathematica4.0 with an invalid memory access from MathDLL.dll). I am running Mathematica 4.1, and have this problem consistently on 4 different machines. Here is the code, if it doesn't crash the first time, it will the second or third: (* w = Compile[{{xj, _Real, 0}, {XX, _Real, 1}, {YY, _Real, 1}, {h, _Real, 0}, {nn, _Integer, 0}, {ord, _Integer, 0}}, First[Inverse[Sum[Outer[Times, Table[If[Positive[q], (XX[[i]] - xj)^q, 1], {q, 0, ord}], Table[If[Positive[q], (XX[[i]] - xj)^q, 1.], {q, 0, ord}]*E^(-0.5*((XX[[i]] - xj)/h)^2)], {i, nn}]] . Sum[(Table[If[Positive[q], (XX[[i]] - xj)^q, 1.], {q, 0, ord}]*YY[[i]])* E^(-0.5*((XX[[i]] - xj)/h)^2), {i, nn}]]]; *) (* \!\(tt = MemoryInUse[]; ListPlot[Table[{\((i + 1)\)\^2, \(Timing[ nn = \((i + 1)\)\^2; \[Epsilon] = Table[Random[]*3, {i, nn}]; testX = Table[i* .3 - Random[]*2, {i, nn}]; testY = Table[Sin[i/3] - 2, {i, nn}] + \[Epsilon]; Map[w[#, testX, testY, .1 + Random[], nn, 0] &, testX];]\)[\([1]\)]/Second}, {i, 15}], PlotJoined -> True, PlotLabel -> "\<Calculation Times as a function of n\>"]; MemoryInUse[] - tt\) *)