Prev Next multi_newton

Multi-Threaded Newton's Method Routine

Syntax
multi_newton(xoutfunn_gridxlowxupepsilonmax_itr)

Purpose
Determine the argument values  x \in [a, b] (where  a < b ) such that  f(x) = 0 .

Method
For  i = 0 , \ldots , n , we define the i-th grid point  g_i and the i-th interval  I_i by  \[
\begin{array}{rcl}
     g_i & = & a \frac{n - i}{n} +  b \frac{i}{n}
     \\
     I_i & = & [ g_i , g_{i+1} ]
\end{array}
\] 
Newton's method is applied starting at the center of each of the intervals  I_i for  i = 0 , \ldots , n-1 and at most one zero is found for each interval.

xout
The argument xout has the prototype
     CppAD::vector<double> &
xout
The input size and value of the elements of xout do not matter. Upon return from multi_newton, the size of xout is less than  n and  \[
     | f( xout[i] ) | \leq epsilon
\] 
for each valid index i. Two  x solutions are considered equal (and joined as one) if the absolute difference between the solutions is less than  (b - a) / n .

fun
The argument fun has prototype
     
Fun &fun
This argument must evaluate the function  f(x) using the syntax
     
f = fun(x)
where the argument x and the result f have the prototypes
     const AD<double> &
x 
     AD<double>        
f
.

n_grid
The argument n_grid has prototype
     size_t 
n_grid
It specifies the number of grid points; i.e.,  n in the method above.

xlow
The argument xlow has prototype
     double 
xlow
It specifies the lower limit for the entire search; i.e.,  a in the method above.

xup
The argument xup has prototype
     double 
xup
It specifies the upper limit for the entire search; i.e.,  b in the method above.

epsilon
The argument epsilon has prototype
     double 
epsilon
It specifies the convergence criteria for Newton's method in terms of how small the function value must be.

max_itr
The argument max_itr has prototype
     size_t 
max_itr
It specifies the maximum number of iterations of Newton's method to try before giving up on convergence.
Input File: openmp/multi_newton.hpp