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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!