Re: Recursion limit: a good idea to ignore?
- To: mathgroup at smc.vnet.net
- Subject: [mg82359] Re: Recursion limit: a good idea to ignore?
- From: David Bailey <dave at Remove_Thisdbailey.co.uk>
- Date: Thu, 18 Oct 2007 04:57:11 -0400 (EDT)
- References: <feutsm$st$1@smc.vnet.net>
Will Robertson wrote: > Hello, > > I've written a potentially inefficient algorithm to combine multiple > joined polygons into a single one. On large plots I get the warning > "$RecursionLimit::reclim: Recursion depth of 256 exceeded." and a > bunch of errors because of this. > > Now, should I try and re-write my program (the speed of it is not > entirely critical) to avoid recursion or is it "okay" to locally > remove the recursion limit for such code? > > I'll try and post an actual example of my code once I've tidied it up > a little. > > Many thanks, > Will > > It is perfectly reasonable to require a larger recursion limit for certain algorithms. The default value is fairly low so that programs that are out of control abort before using too much time and memory. Since a speedy abort in such cases is definitely valuable, it may be worth increasing the recursion limit only for the duration of the algorithm that requires it. David Bailey http://www.dbaileyconsultancy.co.uk