Skip to content

Instantly share code, notes, and snippets.

@sverhoeven
Created October 2, 2020 09:32
Show Gist options
  • Save sverhoeven/70ea5b0d669e8d34c58e5fec2871b3d2 to your computer and use it in GitHub Desktop.
Save sverhoeven/70ea5b0d669e8d34c58e5fec2871b3d2 to your computer and use it in GitHub Desktop.
run-cpp-on-web: vega
#ifndef H_NEWTONRAPHSON_HPP
#define H_NEWTONRAPHSON_HPP
#include <vector>
struct Iteration {
int index;
float x;
float y;
float slope;
float delta_x;
};
class NewtonRaphson {
public:
NewtonRaphson(float tolerance_in);
float solve(float initial_guess);
std::vector<Iteration> iterations;
private:
float tolerance;
};
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment