The specialized Stepper to compute a step with the Bisection Method.
More...
#include <stepper_def.hpp>
|
| | BisectionStepper (std::function< double(double)> fun, bool aitken_mode, Eigen::Vector2d _int) |
| | Constructor of a BisectionStepper object.
|
| |
| Eigen::Vector2d | compute_step (Eigen::Vector2d previous_iteration) override |
| | Specialized method to compute and return a new step with Bisection. Let left_edge = a, right_edge = b; then we have an interval [a,b] such that f(a)*f(b) < 0; We compute x_new = (a+b)/2; if f(a)*f(x_new) < 0 then a_new = a, b_new = x_new, otherwise a_new = x_new, b_new = b -> left_edge = a_new, right_edge = b_new.
|
| |
| | BisectionStepper (std::function< double(double)> fun, bool aitken_mode, Eigen::Vector2d _int) |
| |
| Eigen::Vector2d | compute_step (Eigen::Vector2d last_iter) |
| | Virtual function to compute the step for the method -> overridden by all the methods.
|
| |
| | StepperBase (std::function< double(double)> fun, bool aitken_mode) |
| | Constructor for virtual Stepper class, which will be inherited by the daughters.
|
| |
| virtual | ~StepperBase ()=default |
| |
| Eigen::Vector2d | step (Eigen::Vector2d previous_step) |
| | Method handling all the steps involved in computing the new guess.
|
| |
|
| Eigen::Vector2d | aitken_step (Eigen::Vector2d previous_iter) |
| | Method to handle the computation of a step using Aitken's acceleration.
|
| |
| std::function< double(double)> | function |
| | Function to compute the root of.
|
| |
| bool | aitken_requirement |
| | Option to use Aitken's acceleration.
|
| |
template<typename T>
class BisectionStepper< T >
The specialized Stepper to compute a step with the Bisection Method.
◆ BisectionStepper() [1/2]
Constructor of a BisectionStepper object.
- Parameters
-
| fun | The function to find the root of |
| aitken_mode | Option to use Aitken's acceleration |
| _int | Initial interval such that f(_int(0))*f(_int(1)) < 0 |
◆ BisectionStepper() [2/2]
◆ compute_step() [1/2]
| Eigen::Vector2d BisectionStepper< Eigen::Vector2d >::compute_step |
( |
Eigen::Vector2d |
| ) |
|
|
virtual |
Virtual function to compute the step for the method -> overridden by all the methods.
- Parameters
-
| previous_iteration | 2-dimensional vector storing x(i-1) and f(x(i-1)) - previous guesses |
- Returns
- 2-dimensional vector storing x(i) and f(x(i)) - new guesses
Implements StepperBase< T >.
◆ compute_step() [2/2]
template<typename T >
| Eigen::Vector2d BisectionStepper< T >::compute_step |
( |
Eigen::Vector2d |
previous_iteration | ) |
|
|
overridevirtual |
Specialized method to compute and return a new step with Bisection. Let left_edge = a, right_edge = b; then we have an interval [a,b] such that f(a)*f(b) < 0; We compute x_new = (a+b)/2; if f(a)*f(x_new) < 0 then a_new = a, b_new = x_new, otherwise a_new = x_new, b_new = b -> left_edge = a_new, right_edge = b_new.
- Parameters
-
| previous_iteration | 2-dimensional vector storing x(i-1) and f(x(i-1)) - old guesses |
- Returns
- 2-dimensional vector storing x(i) = (left_edge + right_edge) / 2 and f(x(i)) - new guesses
Implements StepperBase< T >.
◆ left_edge
◆ right_edge
Bounds of the interval to use (updated at each step)
The documentation for this class was generated from the following file: