14#ifndef ROOT_STEPPER_DEF_HPP
15#define ROOT_STEPPER_DEF_HPP
41 Eigen::Vector2d
aitken_step(Eigen::Vector2d previous_iter);
50 StepperBase(std::function<
double(
double)> fun,
bool aitken_mode);
58 Eigen::Vector2d
step(Eigen::Vector2d previous_step);
76 NewtonRaphsonStepper(std::function<
double(
double)> fun,
bool aitken_mode, std::function<
double(
double)> der);
82 Eigen::Vector2d
compute_step(Eigen::Vector2d previous_iteration)
override;
98 FixedPointStepper(std::function<
double(
double)> fun,
bool aitken_mode, std::function<
double(
double)> g_fun);
105 Eigen::Vector2d
compute_step(Eigen::Vector2d previous_iteration)
override;
122 ChordsStepper(std::function<
double(
double)> fun,
bool aitken_mode, Eigen::Vector2d _int);
131 Eigen::Vector2d
compute_step(Eigen::Vector2d previous_iteration)
override;
147 BisectionStepper(std::function<
double(
double)> fun,
bool aitken_mode, Eigen::Vector2d _int);
156 Eigen::Vector2d
compute_step(Eigen::Vector2d previous_iteration)
override;
The specialized Stepper to compute a step with the Bisection Method.
Definition stepper_def.hpp:136
Eigen::Vector2d compute_step(Eigen::Vector2d previous_iteration) override
Specialized method to compute and return a new step with Bisection. Let left_edge = a,...
BisectionStepper(std::function< double(double)> fun, bool aitken_mode, Eigen::Vector2d _int)
Constructor of a BisectionStepper object.
double right_edge
Bounds of the interval to use (updated at each step)
Definition stepper_def.hpp:138
double left_edge
Definition stepper_def.hpp:138
The specialized Stepper to compute a step with the Chords Method (also called Secants in literature)
Definition stepper_def.hpp:110
double iter_zero
The two previous guesses required at each iteration.
Definition stepper_def.hpp:112
Eigen::Vector2d compute_step(Eigen::Vector2d previous_iteration) override
Specialized method to compute and return a new step with Chords.
ChordsStepper(std::function< double(double)> fun, bool aitken_mode, Eigen::Vector2d _int)
Constructor for the ChordsStepper class.
double iter_minus_1
Definition stepper_def.hpp:112
The specialized Stepper to compute a step with the Fixed Point method.
Definition stepper_def.hpp:87
FixedPointStepper(std::function< double(double)> fun, bool aitken_mode, std::function< double(double)> g_fun)
The specialized constructor - initializes the function and the fixed point function.
std::function< double(double)> fixed_point_function
tores the fixed point to use in the steps
Definition stepper_def.hpp:89
Eigen::Vector2d compute_step(Eigen::Vector2d previous_iteration) override
Specialized method to compute and return a new step with FP.
The specialized Stepper to compute a step with the Newton-Raphson method.
Definition stepper_def.hpp:65
std::function< double(double)> derivative
Stores the derivative of the function.
Definition stepper_def.hpp:67
Eigen::Vector2d compute_step(Eigen::Vector2d previous_iteration) override
Specialized method to compute and return a new step with NR.
NewtonRaphsonStepper(std::function< double(double)> fun, bool aitken_mode, std::function< double(double)> der)
The specialized constructor - initializes the function and the derivative.
The virtual mother stepper class which defines constructor and method in common for all the methods.
Definition stepper_def.hpp:24
Eigen::Vector2d step(Eigen::Vector2d previous_step)
Method handling all the steps involved in computing the new guess.
Definition stepper.hpp:17
bool aitken_requirement
Option to use Aitken's acceleration.
Definition stepper_def.hpp:27
std::function< double(double)> function
Function to compute the root of.
Definition stepper_def.hpp:26
virtual ~StepperBase()=default
Eigen::Vector2d aitken_step(Eigen::Vector2d previous_iter)
Method to handle the computation of a step using Aitken's acceleration.
Definition stepper.hpp:26
virtual Eigen::Vector2d compute_step(Eigen::Vector2d)=0
Virtual function to compute the step for the method -> overridden by all the methods.