MathGroup Archive 2002

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Arbitrary Crash with Compile

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?


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,
     {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,
              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 ->
    PlotLabel -> "\<Calculation Times as a function of n\>"];
  MemoryInUse[] - tt\)

  • Prev by Date: Re: creating adjacency matrices
  • Next by Date: More levels of subsection nesting
  • Previous by thread: Re: Arbitrary Crash with Compile
  • Next by thread: Getting hierarchies of partitions