|
OK, Math::RootFind it is. One more question, on interface: All of the algorithms have two parameters, e (as in epsilon) and max_iter, which set precision and max run-time respectively. They have reasonable defaults, and probably won't be changed often, so I am loathe to make them function arguments. So I have made them package globals with accessors to alter them. The undesirable effect of course is that altering them in one part of your program effects all uses of the algorithm, which may not be intended. It looks like this. bisection( \&func, -10,10 ); #Normal call with defaults epsilon(.01); max_iter(10); bisection( \&func, -10, 10); # From now on all calls will use the above e and max_iter I still think putting them as function arguments would be redundant in most cases, although maybe optional arguments would be best (just thinking out loud). Any other suggestions as to how to handle sort of 'config' settings? Regards, Spencer Ogden Shlomi Fish wrote: On Tuesday 15 February 2005 09:22, C. Chad Wallace wrote: |
- Algorithm::RootFind Request for Comments Spencer Ogden
- RE: Algorithm::RootFind Request for Comments Hugh S. Myers
- Re: Algorithm::RootFind Request for Comments C. Chad Wallace
- Re: Algorithm::RootFind Request for Comments Shlomi Fish
- Re: Algorithm::RootFind Request for Comments Spencer Ogden
- Re: Algorithm::RootFind Request for Comme... David Landgren
- Re: Algorithm::RootFind Request for ... David Landgren
- Re: Algorithm::RootFind Request for ... Smylers
- Re: Algorithm::RootFind Request for Comme... A. Pagaltzis
