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:
  
Spencer Ogden wrote:
    
I have a collection of functions for using numerical computation to
approximate the roots of arbitrary functions. It is a function
library, no OO. I am wondering where to put it, either Algorithm:: or
Math::
      
I think Math::RootFind would be best, since the package is of
specifically math-oriented algorithms. My first impression of the name
"Algorithm::RootFind" was that it might find the root of a binary tree
or something similar.

    

I second that. Math::RootFind would be better.

Regards,

	Shlomi Fish

---------------------------------------------------------------------
Shlomi Fish      [EMAIL PROTECTED]
Homepage:        http://www.shlomifish.org/

Knuth is not God! It took him two days to build the Roman Empire.

  

Reply via email to