MathGroup Archive 1998

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

Search the Archive

Re: Split in Mathematica 2.2/ $MaxRecursion crash


Hello

I can confirm the slow behaviour of Split on a PowerMac 6100/66 (which
has a 601 PPC, vm turned on) reported recently here, and the correct
fast behaviour on an Irix. 

One of the proposed
user-implemented alternatives however is even crashing my Mac:

split2[li_,fQ_:SameQ]:=Module[{liLength,index,i},liLength=Length at li;
index={};For[i=1,i<liLength,i++,
      If[Not@(fQ@@Part[li,{i,i+1}]),index={index,i}]];
(Head at li)@@((Take[li,#]&)/@(
            
Transpose[{Flatten[{1,#+1}],Flatten[{#,liLength}]}]&)@index)];

This being highly recursive, to execute (say)

w = Table[Random[Integer], {10000}]; split2[w];//Timing

I need to increase 

$RecursionLimit=10000;

This works on our Irix but crashes my poor little Mac (Bus error...,
restart required) after one error message  $RecursionLimit::"reclim": 
with a lower $RecursionLimit, I either get the usual bunch of error
messages or just one of them, and the Mac crashes. Enjoy.

Matthias Weber


  • Prev by Date: Re: How to Extract a common factor from a Sum
  • Next by Date: Re: How to Extract a common factor from a Sum
  • Previous by thread: Re: Solving system of Inequalites
  • Next by thread: Re: Re: Split in Mathematica 2.2/ $MaxRecursion crash