You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 10, 2022. It is now read-only.
Currently I am developing the routines for finding roots of arbitrary one-dimensional functions.
The idea is to offer simple functions that allow it, without the need to implement a robust search system such as workspaces and a little bigger structures like thoose.
Discussion
Since I do not have much knowledge about the different existing methods for the search of roots, would be grateful for any type of contribution that could be made.
In the first comment I show the methods that I plan to implement in this new feature as well as the prototype of each of them with the idea that each one of them is up for discussion.
Contributing
Those who wish to contribute to this module are asked to discuss the implementation of existing methods as well as the suggestion and development of new ones.
The text was updated successfully, but these errors were encountered:
/** * Find the root of a function using a bisection method * * @param xmin lower bound * @param xmax upper bound * @param epsrel if the relative improvement over the root is less than this value, * then break; * @param epsabs if the absolute improvement over the root is less than this value, * then break; * @param res contains the root on exit * @param n_max maximum number of iterations * @param func a function pointer * @return CML_SUCCESS or CML_FAILURE if n_max reached */intcml_root_bisection(cml_function_t*func, doublexmin, doublexmax,
doubleepsrel, doubleepsabs,
size_tn_max, double*res);
/** * Find the root of a function using Newton's algorithm with the Armijo line * search to ensure the absolute value of the function decreases along the * iterations. The descent direction at step k is given by * * \f[ d_k = f(x_k) / f'(x_k) \f] * * Determine \f$ \alpha_k = \max\{2^{-j}, j \ge 0\} \f$ s.t. * * \f[ f(x_k + \alpha_k d_k) \le f(x_k) (1 - \omega \alpha_k) \f] * * where in this implementation \f$ \omega = 10^{-4} \f$. * * @param cml_function_fdf_t pointer * @param x0 initial guess * @param x_eps if the relative improvement over the root is less than this value, * then stop; * @param fx_eps if |f(x)| < fx_eps * then stop; * @param n_max maximum number of iterations * @param res contains the root on exit * @return CML_SUCCESS or CML_FAILURE if n_max reached */intcml_root_newton(cml_function_fdf_t*func, doublex0,
doublex_eps, doublefx_eps,
intn_max, double*res);
One Dimensional Root-Finding
Feature
Currently I am developing the routines for finding roots of arbitrary one-dimensional functions.
The idea is to offer simple functions that allow it, without the need to implement a robust search system such as workspaces and a little bigger structures like thoose.
Discussion
Since I do not have much knowledge about the different existing methods for the search of roots, would be grateful for any type of contribution that could be made.
In the first comment I show the methods that I plan to implement in this new feature as well as the prototype of each of them with the idea that each one of them is up for discussion.
Contributing
Those who wish to contribute to this module are asked to discuss the implementation of existing methods as well as the suggestion and development of new ones.
The text was updated successfully, but these errors were encountered: