Created
October 2, 2020 09:32
-
-
Save sverhoeven/70ea5b0d669e8d34c58e5fec2871b3d2 to your computer and use it in GitHub Desktop.
run-cpp-on-web: vega
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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