bisection_meta.cpp
1 #include "bisection.hpp"
2 #include <string>
3 
4 const std::string casadi::Bisection::meta_doc =
5  "\n"
6  "Bisection method for scalar rootfinding.\n"
7  "\n"
8  "Finds x such that f(x, p) = 0 by repeatedly halving a bracket [a, b]\n"
9  "that is known to contain a sign change of f.\n"
10  "\n"
11  "Requirements:\n"
12  " * The function f must be scalar (n=1).\n"
13  "\n"
14  "Options:\n"
15  " max_iter : Maximum number of iterations (default 100)\n"
16  " max_search : Maximum number of search bracket (default 100)\n"
17  " abstol_step : Absolute tolerance on bracket width (default 1e-9)\n"
18  " abstol : Absolute tolerance of residual (default 1e-9)\n"
19  " lb : Lower bound of initial bracket (default -1e12)\n"
20  " ub : Upper bound of initial bracket (default 1e12)\n"
21  " search_step : Step size for bracket searching (default 1.0)\n"
22  "\n"
23  "Convergence: The iteration stops when either\n"
24  " (b - a) < abstol_step OR |f(mid)| < abstol\n"
25  "\n"
26  ">List of available options\n"
27  "\n"
28  "+-----------+----------+---------------------------------------------------+\n"
29  "| Id | Type | Description |\n"
30  "+===========+==========+===================================================+\n"
31  "| max_iter | OT_INT | Maximum number of bisection iterations |\n"
32  "+-----------+----------+---------------------------------------------------+\n"
33  "| abstol_step | OT_DOUBLE | Absolute tolerance on bracket width |\n"
34  "+-----------+----------+---------------------------------------------------+\n"
35  "| abstol | OT_DOUBLE | Absolute tolerance of residual |\n"
36  "+-----------+----------+---------------------------------------------------+\n"
37  "| lb | OT_DOUBLE | Lower bound of the initial bracket |\n"
38  "+-----------+----------+---------------------------------------------------+\n"
39  "| ub | OT_DOUBLE | Upper bound of the initial bracket |\n"
40  "+-----------+----------+---------------------------------------------------+\n"
41  "| search_step | OT_DOUBLE | Step size for bracket searching |\n"
42  "+-----------+----------+---------------------------------------------------+\n"
43  "| max_search | OT_INT | Maximum number of iterations |\n"
44  "+-----------+----------+---------------------------------------------------+\n"
45  "\n";