Algorithms for root-finding in mathematical functions.
More...
Algorithms for root-finding in mathematical functions.
This module implements a variety of efficient algorithms to compute the roots (zeros) of scalar functions, i.e., points where a function equals zero. It supports techniques ranging from simple bisection and secant methods to more advanced techniques like Newton-Raphson and Brent's method for solving nonlinear equations.
◆ converged()
- Returns
- true if the last computation was successfull
◆ D()
Evaluate the first derivative of \( f(x) \)
This operator provides a convenient way to evaluate the first derivative using the call operator.
- Parameters
-
[in] | x | the point to evaluate \( f'(x) \) |
- Returns
- the value of \( f'(x) \)
◆ DD()
Evaluate the second derivative of \( f(x) \)
This operator allows for an easy evaluation of the second derivative using the call operator.
- Parameters
-
[in] | x | the point to evaluate \( f''(x) \) |
- Returns
- the value of \( f''(x) \)
◆ DDD()
Evaluate the third derivative of \( f(x) \)
This operator enables straightforward evaluation of the third derivative using the call operator.
- Parameters
-
[in] | x | the point to evaluate \( f'''(x) \) |
- Returns
- the value of \( f'''(x) \)
◆ eval()
Evaluate the function \( f(x) \)
- Parameters
-
[in] | x | the point to evaluate \( f(x) \) |
- Returns
- the value of \( f(x) \)
◆ eval_D()
Evaluate the first derivative of \( f(x) \)
- Parameters
-
[in] | x | the point to evaluate \( f'(x) \) |
- Returns
- the value of \( f'(x) \)
◆ eval_DD()
Evaluate the second derivative of \( f(x) \)
- Parameters
-
[in] | x | the point to evaluate \( f''(x) \) |
- Returns
- the value of \( f''(x) \)
◆ eval_DDD()
Evaluate the third derivative of \( f(x) \)
- Parameters
-
[in] | x | the point to evaluate \( f'''(x) \) |
- Returns
- the value of \( f'''(x) \)
◆ num_fun_eval()
- Returns
- the number of evaluation used in the last computation
◆ operator()()
Evaluate the function \( f(x) \)
This operator allows for a more intuitive usage of the function object, enabling the evaluation of the function using the call operator.
- Parameters
-
[in] | x | the point to evaluate \( f(x) \) |
- Returns
- the value of \( f(x) \)
◆ set_max_fun_evaluation()
template<typename Real>
void Utils::Zeros< Real >::set_max_fun_evaluation |
( |
Integer | mfev | ) |
|
Fix the maximum number of evaluation.
- Parameters
-
mfev | the maximum number of evaluation of \( f(x) \) |
◆ set_max_iterations()
template<typename Real>
void Utils::Zeros< Real >::set_max_iterations |
( |
Integer | mit | ) |
|
Fix the maximum number of iteration.
- Parameters
-
mit | the maximum number of iteration |
◆ set_tolerance()
Fix the requested tolerance for ieration stop. Stop when \( |f(x)| < \epsilon \)
- Parameters
-
tol | the requested tolerance |
◆ solve_Chebyshev()
Find the zero of a function wrapped in the class Zeros_base_fun<Real>
starting from guess value x_guess
.
- Parameters
-
x_guess | starting value for iterative method |
fun | the pointer to base class Zeros_base_fun<Real> wrapping the user function |
◆ solve_Halley()
Find the zero of a function wrapped in the class Zeros_base_fun<Real>
starting from guess value x_guess
- Parameters
-
x_guess | starting value for iterative method |
fun | the pointer to base class Zeros_base_fun<Real> wrapping the user function |
◆ solve_Newton()
Find the zero of a function wrapped in the class Zeros_base_fun<Real>
starting from guess value x_guess
- Parameters
-
x_guess | starting value for iterative method |
fun | the pointer to base class Zeros_base_fun<Real> wrapping the user function |
◆ solve_Order16()
Find the zero of a function wrapped in the class Zeros_base_fun<Real>
starting from guess value x_guess
- Parameters
-
x_guess | starting value for iterative method |
fun | the pointer to base class Zeros_base_fun<Real> wrapping the user function |
◆ solve_Order32()
Find the zero of a function wrapped in the class Zeros_base_fun<Real>
starting from guess value x_guess
- Parameters
-
x_guess | starting value for iterative method |
fun | the pointer to base class Zeros_base_fun<Real> wrapping the user function |
◆ solve_Order4()
Find the zero of a function wrapped in the class Zeros_base_fun<Real>
starting from guess value x_guess
- Parameters
-
x_guess | starting value for iterative method |
fun | the pointer to base class Zeros_base_fun<Real> wrapping the user function |
◆ solve_Order8()
Find the zero of a function wrapped in the class Zeros_base_fun<Real>
starting from guess value x_guess
- Parameters
-
x_guess | starting value for iterative method |
fun | the pointer to base class Zeros_base_fun<Real> wrapping the user function |
◆ tolerance()
- Returns
- the tolerance set for computation
◆ used_iter()
- Returns
- the number of iterations used in the last computation
◆ Zeros()
◆ ~Zeros()