Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
solve.hpp File Reference
#include "shammath/matrix.hpp"
#include "shammath/matrix_op.hpp"
#include <cmath>
#include <functional>
Include dependency graph for solve.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  shammath
 namespace for math utility

Functions

template<class T>
float shammath::newton_rhaphson (std::function< T(T)> &&f, std::function< T(T)> &&df, T epsilon_c, T x_0)
template<class T, class Lambda>
std::pair< std::vector< T >, T > shammath::least_squares (const Lambda &f, const std::vector< T > &X, const std::vector< T > &Y, const std::vector< T > &p0, int maxits=1000, T tolerance=1e-9)
 This function determines the best fit parameters \( \vec p \) for a given function \( f(\vec p, \mathbf X) \) with least squares.

Detailed Description