optimization
Class Fzero

java.lang.Object
  |
  +--optimization.Fzero

public class Fzero
extends java.lang.Object

This class was translated by a statistician from the FORTRAN version of dfzero. It is NOT an official translation. When public domain Java optimization routines become available from professional numerical analysts, then THE CODE PRODUCED BY THE NUMERICAL ANALYSTS SHOULD BE USED.

Meanwhile, if you have suggestions for improving this code, please contact Steve Verrill at steve@ws13.fpl.fs.fed.us.


Constructor Summary
Fzero()
           
 
Method Summary
static void fzero(Fzero_methods zeroclass, double[] b, double[] c, double r, double re, double ae, int[] iflag)
           This method searches for a zero of a function f(x) between the given values b and c until the width of the interval (b,c) has collapsed to within a tolerance specified by the stopping criterion, Math.abs(b-c) <= 2.0*(rw*Math.abs(b)+ae).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Fzero

public Fzero()
Method Detail

fzero

public static void fzero(Fzero_methods zeroclass,
                         double[] b,
                         double[] c,
                         double r,
                         double re,
                         double ae,
                         int[] iflag)

This method searches for a zero of a function f(x) between the given values b and c until the width of the interval (b,c) has collapsed to within a tolerance specified by the stopping criterion, Math.abs(b-c) <= 2.0*(rw*Math.abs(b)+ae). The method used is an efficient combination of bisection and the secant rule. The introductory comments from the FORTRAN version are provided below. This method is a translation from FORTRAN to Java of the Netlib (actually it is in the SLATEC library which is available at Netlib) function dfzero. In the FORTRAN code, L.F. Shampine and H.A. Watts are listed as the authors. Translated by Steve Verrill, April 17, 2001.

Parameters:
zeroclass - A class that defines a method, f_to_zero, that returns a value that is to be zeroed. The class must implement the Fzero_methods interface (see the definition in Fzero_methods.java). See FzeroTest.java for an example of such a class. f_to_zero must have one double valued argument.
r - Initial guess of a zero. A (better) guess of a zero of f_to_zero which could help in speeding up convergence. If f_to_zero(b) and f_to_zero(r) have opposite signs, a root will be found in the interval (b,r); if not, but f_to_zero(r) and f_to_zero(c) have opposite signs, a root will be found in the interval (r,c); otherwise, the interval (b,c) will be searched for a possible root. When no better guess is known, it is recommended that r be set to b or c; because if r is not interior to the interval (b,c), it will be ignored.
re - Relative error used for rw in the stopping criterion. If the requested re is less than machine precision, then rw is set to approximately machine precision.
ae - Absolute error used in the stopping criterion. If the given interval (b,c) contains the origin, then a nonzero value should be chosen for AE.