Skip to content
Snippets Groups Projects
Commit a1ff7a97 authored by Gal Sebastian Pascual's avatar Gal Sebastian Pascual
Browse files

Corrected Documentation

parent 366359a7
No related branches found
No related tags found
No related merge requests found
...@@ -106,8 +106,8 @@ Solution Solver::NewtonMethodA(const std::string& eq, const std::string& der, do ...@@ -106,8 +106,8 @@ Solution Solver::NewtonMethodA(const std::string& eq, const std::string& der, do
* relevant & interesting information about the result of the method. * relevant & interesting information about the result of the method.
* *
* @param eqs the equations of the `MultiFunction`'s in the `System` we want to find a root of. * @param eqs the equations of the `MultiFunction`'s in the `System` we want to find a root of.
* @param der the derivative of the `MultiFunction`'s in the `System` we want to find a root of. * @param der the Jacobian of the system of equations we want to find a root of.
* @param start_point the point from which the `Newton` method will start to iterate. * @param start_points the vector from which the `Newton` method will start to iterate.
* @param stop_tol the tolerance at which the `Newton` method considers its sequence to be converged. * @param stop_tol the tolerance at which the `Newton` method considers its sequence to be converged.
* @param max_iter the maximal iterations the `Newton` method will perform before returning, converged or not. * @param max_iter the maximal iterations the `Newton` method will perform before returning, converged or not.
* *
...@@ -132,17 +132,17 @@ Solution Solver::SystemNewtonMethod(const std::vector<std::string>& eqs, const s ...@@ -132,17 +132,17 @@ Solution Solver::SystemNewtonMethod(const std::vector<std::string>& eqs, const s
/** /**
* @brief Applies the non-accelerated `Fixed Point` method to find a root of a given mono-variable equation for given conditions. * @brief Applies the non-accelerated `Fixed Point` method to find a root of a given mono-variable equation for given conditions.
* *
* This function will initialize the `MonoFunction` with the given `equation` & `der`, then perform the `Fixed Point` method on it * This function will initialize the `MonoFunction` with the given `equation` & `fixed point equation`, then perform the `Fixed Point` method on it
* for the given conditions (`max_iter`, `tolerance`, `start_point`). It returns a `Solution` class which encapsulates all * for the given conditions (`max_iter`, `tolerance`, `start_point`). It returns a `Solution` class which encapsulates all
* relevant & interesting information about the result of the method. * relevant & interesting information about the result of the method.
* *
* @param eq the equation of the `MonoFunction` we want to find a root of. * @param eq the equation of the `MonoFunction` we want to find a root of.
* @param der the derivative of the `MonoFunction` we want to find a root of. * @param fp the fixed-point equation `g(x)` such that `f(x) = g(x) - x`
* @param start_point the point from which the `Fixed Point` method will start to iterate. * @param start_point the point from which the `Fixed Point` method will start to iterate.
* @param stop_tol the tolerance at which the `Fixed Point` method considers its sequence to be converged. * @param stop_tol the tolerance at which the `Fixed Point` method considers its sequence to be converged.
* @param max_iter the maximal iterations the `Fixed Point` method will perform before returning, converged or not. * @param max_iter the maximal iterations the `Fixed Point` method will perform before returning, converged or not.
* *
* @return a `Solution`class with all information about the method's result. * @return a `Solution` class with all information about the method's result.
*/ */
Solution Solver::FixedPointMethod(const std::string& eq, const std::string& fp, double start_point, double stop_tol, int max_iter) { Solution Solver::FixedPointMethod(const std::string& eq, const std::string& fp, double start_point, double stop_tol, int max_iter) {
...@@ -156,12 +156,12 @@ Solution Solver::FixedPointMethod(const std::string& eq, const std::string& fp, ...@@ -156,12 +156,12 @@ Solution Solver::FixedPointMethod(const std::string& eq, const std::string& fp,
/** /**
* @brief Applies the accelerated `Fixed Point` method to find a root of a given mono-variable equation for given conditions. * @brief Applies the accelerated `Fixed Point` method to find a root of a given mono-variable equation for given conditions.
* *
* This function will initialize the `MonoFunction` with the given `equation` & `der`, then perform the Accelerated `Fixed Point` method on it * This function will initialize the `MonoFunction` with the given `equation` & `fixed-point equation`, then perform the Accelerated `Fixed Point` method on it
* for the given conditions (`max_iter`, `tolerance`, `start_point`), by instantiating the `Aitken` method with this `Fixed Point` class. * for the given conditions (`max_iter`, `tolerance`, `start_point`), by instantiating the `Aitken` method with this `Fixed Point` class.
* It returns a `Solution` class which encapsulates all relevant & interesting information about the result of the method. * It returns a `Solution` class which encapsulates all relevant & interesting information about the result of the method.
* *
* @param eq the equation of the `MonoFunction` we want to find a root of. * @param eq the equation of the `MonoFunction` we want to find a root of.
* @param der the derivative of the `MonoFunction` we want to find a root of. * @param fp the fixed-point equation `g(x)` such that `f(x) = g(x) - x`
* @param start_point the point from which the `Aitken` ( & `Fixed Point`) method will start to iterate. * @param start_point the point from which the `Aitken` ( & `Fixed Point`) method will start to iterate.
* @param stop_tol the tolerance at which the `Aitken` method considers its sequence to be converged. * @param stop_tol the tolerance at which the `Aitken` method considers its sequence to be converged.
* @param max_iter the maximal iterations the `Aitken` method will perform before returning, converged or not. * @param max_iter the maximal iterations the `Aitken` method will perform before returning, converged or not.
...@@ -186,12 +186,11 @@ Solution Solver::FixedPointMethodA(const std::string& eq, const std::string& fp, ...@@ -186,12 +186,11 @@ Solution Solver::FixedPointMethodA(const std::string& eq, const std::string& fp,
* relevant & interesting information about the result of the method. * relevant & interesting information about the result of the method.
* *
* @param eq the equation of the `MonoFunction` we want to find a root of. * @param eq the equation of the `MonoFunction` we want to find a root of.
* @param der the derivative of the `MonoFunction` we want to find a root of.
* @param start_point the 2 first points/iterations from which the `Chord` method will start to iterate. * @param start_point the 2 first points/iterations from which the `Chord` method will start to iterate.
* @param stop_tol the tolerance at which the `Chord` method considers its sequence to be converged. * @param stop_tol the tolerance at which the `Chord` method considers its sequence to be converged.
* @param max_iter the maximal iterations the `Chord` method will perform before returning, converged or not. * @param max_iter the maximal iterations the `Chord` method will perform before returning, converged or not.
* *
* @return a `Solution`class with all information about the method's result. * @return a `Solution` class with all information about the method's result.
*/ */
Solution Solver::ChordMethod(const std::string& eq, std::pair<double, double> start_point, double stop_tol, int max_iter) { Solution Solver::ChordMethod(const std::string& eq, std::pair<double, double> start_point, double stop_tol, int max_iter) {
...@@ -203,19 +202,18 @@ Solution Solver::ChordMethod(const std::string& eq, std::pair<double, double> st ...@@ -203,19 +202,18 @@ Solution Solver::ChordMethod(const std::string& eq, std::pair<double, double> st
} }
/** /**
* @brief Applies the non-accelerated `Bisection` method to find a root of a given mono-variable equation for given conditions. * @brief Applies the `Bisection` method to find a root of a given mono-variable equation for given conditions.
* *
* This function will initialize the `MonoFunction` with the given `equation` & `der`, then perform the `Bisection` method on it * This function will initialize the `MonoFunction` with the given `equation`, then perform the `Bisection` method on it
* for the given conditions (`max_iter`, `tolerance`, `start_point`). It returns a `Solution` class which encapsulates all * for the given conditions (`max_iter`, `tolerance`, `start_point`). It returns a `Solution` class which encapsulates all
* relevant & interesting information about the result of the method. * relevant & interesting information about the result of the method.
* *
* @param eq the equation of the `MonoFunction` we want to find a root of. * @param eq the equation of the `MonoFunction` we want to find a root of.
* @param der the derivative of the `MonoFunction` we want to find a root of.
* @param start_point the interval of points from which the `Bisection` method will start to iterate. * @param start_point the interval of points from which the `Bisection` method will start to iterate.
* @param stop_tol the tolerance at which the `Bisection` method considers its sequence to be converged. * @param stop_tol the tolerance at which the `Bisection` method considers its sequence to be converged.
* @param max_iter the maximal iterations the `Bisection` method will perform before returning, converged or not. * @param max_iter the maximal iterations the `Bisection` method will perform before returning, converged or not.
* *
* @return a `Solution`class with all information about the method's result. * @return a `Solution` class with all information about the method's result.
*/ */
Solution Solver::BisectionMethod(const std::string& eq, std::pair<double, double> start_point, double stop_tol, int max_iter) { Solution Solver::BisectionMethod(const std::string& eq, std::pair<double, double> start_point, double stop_tol, int max_iter) {
...@@ -255,7 +253,7 @@ void Solver::PointOutput(Solution root, const std::string& method, bool Aitken, ...@@ -255,7 +253,7 @@ void Solver::PointOutput(Solution root, const std::string& method, bool Aitken,
* This function will print all (relevant) info included in the `Solution`, customized towards the root being (within) an interval. * This function will print all (relevant) info included in the `Solution`, customized towards the root being (within) an interval.
* It is called for the showcasing of the solutions of the `Bisection` method. * It is called for the showcasing of the solutions of the `Bisection` method.
* *
* @param root the root that includes all relevant info about the solution/result of the algorithm. * @param root the Solution that includes all relevant info about the solution/result of the algorithm.
* @param method the method that was used, in string form. * @param method the method that was used, in string form.
* @param function the function for which we attempted to find a root (in string format). * @param function the function for which we attempted to find a root (in string format).
* *
...@@ -277,8 +275,7 @@ void Solver::IntervalOutput(Solution root, const std::string& method, const std: ...@@ -277,8 +275,7 @@ void Solver::IntervalOutput(Solution root, const std::string& method, const std:
* This function will print all (relevant) info included in the `Solution`, customized towards the root being a vector of doubles (roots). * This function will print all (relevant) info included in the `Solution`, customized towards the root being a vector of doubles (roots).
* It is called for the showcasing of the solutions of the `Newton` method for Systems. * It is called for the showcasing of the solutions of the `Newton` method for Systems.
* *
* @param root the root that includes all relevant info about the solution/result of the algorithm. * @param root the Solution that includes all relevant info about the solution/result of the algorithm.
* @param method the method that was used, in string form.
* @param function the system of functions for which we attempted to find a root (in string format). * @param function the system of functions for which we attempted to find a root (in string format).
* *
*/ */
......
...@@ -357,6 +357,7 @@ TEST(ConfigFile, Errors) { ...@@ -357,6 +357,7 @@ TEST(ConfigFile, Errors) {
EXPECT_THROW(read_test.getFixedPoint(), std::invalid_argument); EXPECT_THROW(read_test.getFixedPoint(), std::invalid_argument);
} }
int main() { int main() {
testing::InitGoogleTest(); testing::InitGoogleTest();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment