suanPan
🧮 An Open Source, Parallel and Heterogeneous Finite Element Analysis Framework
Loading...
Searching...
No Matches
ridders.hpp File Reference
#include <suanPan.h>
Include dependency graph for ridders.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

template<std::invocable< double > T>
double ridders (const T &func, double x1, double f1, double x2, double f2, const double tolerance)
 Implements Ridders' method for finding the root of a function.
 
template<std::invocable< double > T>
double ridders (const T &func, double x1, double x2, const double tolerance)
 
template<std::invocable< double > T>
double ridders_guess (const T &func, double x1, double f1, double x2, double f2, const double tolerance)
 
template<std::invocable< double > T>
double ridders_guess (const T &func, double x1, double x2, const double tolerance)
 

Function Documentation

◆ ridders() [1/2]

template<std::invocable< double > T>
double ridders ( const T &  func,
double  x1,
double  f1,
double  x2,
double  f2,
const double  tolerance 
)

Implements Ridders' method for finding the root of a function.

Ridders' method is a root-finding algorithm that combines the bisection method with an exponential interpolation to achieve quadratic convergence under ideal conditions.

Template Parameters
TA callable type that takes a double as input and returns a double.
Parameters
funcThe function for which the root is to be found. It must be callable with a double argument.
x1The first initial guess for the root.
f1The value of the function at x1 (i.e., func(x1)).
x2The second initial guess for the root.
f2The value of the function at x2 (i.e., func(x2)).
toleranceThe tolerance for the root-finding process.
Returns
The estimated root of the function within the specified tolerance.
Here is the caller graph for this function:

◆ ridders() [2/2]

template<std::invocable< double > T>
double ridders ( const T &  func,
double  x1,
double  x2,
const double  tolerance 
)
Here is the call graph for this function:

◆ ridders_guess() [1/2]

template<std::invocable< double > T>
double ridders_guess ( const T &  func,
double  x1,
double  f1,
double  x2,
double  f2,
const double  tolerance 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ridders_guess() [2/2]

template<std::invocable< double > T>
double ridders_guess ( const T &  func,
double  x1,
double  x2,
const double  tolerance 
)
Here is the call graph for this function: