Theoretica
A C++ numerical and automatic mathematical library
|
Root approximation of real functions. More...
#include "../core/function.h"
#include "../calculus/deriv.h"
#include "../autodiff/dual.h"
#include "../autodiff/dual2.h"
#include "../algebra/vec.h"
#include "../complex/complex.h"
Go to the source code of this file.
Namespaces | |
theoretica | |
Main namespace of the library which contains all functions and objects. | |
Functions | |
template<typename RealFunction , typename Vector = vec2> | |
std::vector< Vector > | theoretica::find_root_intervals (RealFunction f, real a, real b, unsigned int steps=10) |
Find candidate intervals for root finding by evaluating a function at equidistant points inside an interval [a, b] and checking its sign. More... | |
template<typename RealFunction > | |
real | theoretica::root_bisect (RealFunction f, real a, real b, real tol=OPTIMIZATION_TOL, unsigned int max_iter=OPTIMIZATION_BISECTION_ITER) |
Find the root of a univariate real function using bisection inside a compact interval [a, b] where \(f(a) * f(b) < 0\). More... | |
template<typename RealFunction > | |
real | theoretica::root_itp (RealFunction f, real a, real b, real tol=OPTIMIZATION_TOL, unsigned int n0=1, real k1=0.0) |
Find a root of a univariate real function using the ITP (Interpolate-Truncate-Project) method, by bracketing the zero inside a compact interval [a, b] where \(f(a) * f(b) < 0\). More... | |
template<typename RealFunction > | |
real | theoretica::root_newton (RealFunction f, RealFunction Df, real guess=0.0, real tol=OPTIMIZATION_TOL, unsigned int max_iter=OPTIMIZATION_NEWTON_ITER) |
Find a root of a univariate real function using Newton's method. More... | |
real | theoretica::root_newton (dual(*f)(dual), real guess=0, real tol=OPTIMIZATION_TOL, unsigned int max_iter=OPTIMIZATION_NEWTON_ITER) |
Find a root of a univariate real function using Newton's method, computing the derivative using automatic differentiation. More... | |
template<typename Type = real, typename ComplexFunction = std::function<complex<Type>(complex<Type>)>> | |
complex< Type > | theoretica::root_newton (ComplexFunction f, ComplexFunction Df, complex< Type > guess, real tol=OPTIMIZATION_TOL, unsigned int max_iter=OPTIMIZATION_NEWTON_ITER) |
Find a root of a complex function using Newton's method. More... | |
template<typename RealFunction > | |
real | theoretica::root_halley (RealFunction f, RealFunction Df, RealFunction D2f, real guess=0, real tol=OPTIMIZATION_TOL, unsigned int max_iter=OPTIMIZATION_HALLEY_ITER) |
Find a root of a univariate real function using Halley's method. More... | |
real | theoretica::root_halley (dual2(*f)(dual2), real guess=0, real tol=OPTIMIZATION_TOL, unsigned int max_iter=OPTIMIZATION_HALLEY_ITER) |
Find a root of a univariate real function using Halley's method, leveraging automatic differentiation to compute the first and second derivatives of the function. More... | |
template<typename RealFunction > | |
real | theoretica::root_steffensen (RealFunction f, real guess=0, real tol=OPTIMIZATION_TOL, unsigned int max_iter=OPTIMIZATION_STEFFENSEN_ITER) |
Find a root of a univariate real function using Steffensen's method. More... | |
template<typename RealFunction > | |
real | theoretica::root_chebyshev (RealFunction f, RealFunction Df, RealFunction D2f, real guess=0, real tol=OPTIMIZATION_TOL, unsigned int max_iter=OPTIMIZATION_CHEBYSHEV_ITER) |
Find a root of a univariate real function using Chebyshev's method. More... | |
real | theoretica::root_chebyshev (dual2(*f)(dual2), real guess=0, real tol=OPTIMIZATION_TOL, unsigned int max_iter=OPTIMIZATION_CHEBYSHEV_ITER) |
Find a root of a univariate real function using Chebyshev's method, by computing the first and second derivatives using automatic differentiation. More... | |
template<typename RealFunction > | |
real | theoretica::root_ostrowski (RealFunction f, RealFunction Df, real guess=0.0, real tol=OPTIMIZATION_TOL, unsigned int max_iter=OPTIMIZATION_OSTROWSKI_ITER) |
Find a root of a univariate real function using Ostrowski's method. More... | |
template<typename RealFunction > | |
real | theoretica::root_jarrat (RealFunction f, RealFunction Df, real guess=0.0, real tol=OPTIMIZATION_TOL, unsigned int max_iter=OPTIMIZATION_JARRAT_ITER) |
Find a root of a univariate real function using Jarrat's method. More... | |
template<typename RealFunction > | |
std::vector< real > | theoretica::roots (RealFunction f, real a, real b, real tol=OPTIMIZATION_TOL, real steps=10) |
Find the roots of a univariate real function inside a given interval, by first searching for candidate intervals and then applying bracketing methods. More... | |
template<typename Field > | |
std::vector< Field > | theoretica::roots (const polynomial< Field > &p, real tolerance=OPTIMIZATION_TOL, unsigned int steps=0) |
Find all the roots of a polynomial. More... | |
Root approximation of real functions.