Question
below is the class for root finder i need the full code includeing main class for below method in c++ class RootFinder { public: RootFinder()
below is the class for root finder
i need the full code includeing main class for below method in c++
class RootFinder {
public:
RootFinder() : tol_f(0.0), rel_tol_f(0.0), tol_x(0.0), rel_tol_x(0.0), max_iter(0) {} ~RootFinder() {}
int root_bisection(double target, double x_low, double x_high, double & x, int & num_iter) const;
int root_NR(double target, double x0, double & x, int & num_iter) const;
int root_secant(double target, double x0, double x1, double & x, int & num_iter) const;
// data double tol_f;
double rel_tol_f; double tol_x;
double rel_tol_x; int max_iter;
// function pointers double (*func1)(double x);
void (*func2)(double x, double &f, double &fprime); };
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started