#include <Bisection.h>
Inheritance diagram for Bisection< functor, real >:


assumption: _f is monotonic. _f maybe be either monotonically increasing or decreasing. _f is well defined on the interval _x0 to _x1. description: This is an encapsulation of the Bisection algorithm.
Definition at line 115 of file Bisection.h.
Public Member Functions | |
| Bisection (real X0, real X1, real Fsolve, real Delta, real Epsilon, unsigned int max_iter, functor &obj, real(functor::*f)(real)) | |
| Bisection (real X0, real X1, real FX0, real FX1, real Fsolve, real Delta, real Epsilon, unsigned int max_iter, functor &obj, real(functor::*f)(real)) | |
| void | do_iteration (bool print_results) |
| This function does the calculations. | |
| real | get_x_mid () const |
| This returns the final value of x. | |
| bool | get_converged () const |
| This true if the final values of the series satisfy the convergence. | |
| real | get_df_dx () const |
Protected Attributes | |
| real | _x0 |
| starting value of xlower, it must satisfy | |
| real | _x1 |
| starting value of xupper | |
| real | _fsolve |
| final value of solution | |
| real | _delta |
| change in x which will terminate the loop | |
| real | _epsilon |
| change in y which will terminate the loop | |
| real | _x_lower |
| the lower bound for x | |
| real | _x_upper |
| the upper bound for x | |
| real | _F_x_lower |
| value of _f at the lower bound | |
| bool | _calc_F_x_lower |
| this is a temporary variable which determins if F_x_lower is calculated prior to the first iteration | |
| real | _F_x_upper |
| value of _f at the upper bound | |
| bool | _calc_F_x_upper |
| this is a temporary variable which determins if F_x_lower is calculated prior to the first iteration | |
| real | _x_mid |
| the next value of x to be valued with _f | |
| real | _dx |
| the change in x | |
| real | _F_x_mid |
| the value of _f evaluated at x_mid | |
| real | _abs_error |
| absolute difference between _f(x) and _fsolve | |
| bool | _is_increasing |
| is true if f is increasing | |
| int | _max_iter |
| The maximum number of iterations. | |
| int | i |
| The iteration variable. After do_iteration is called, this is the last iteration before the loop was terminated. | |
| bool | _converged |
| True if the function finished in less than max_iterations. | |
| functor & | _obj |
| This is a reference to the object which contains the hidden data for f. | |
| real(functor::* | _f )(real) |
| This points to the function which is being solved. | |
1.5.1