6 #ifndef THEORETICA_MULTI_ROOTS_H
7 #define THEORETICA_MULTI_ROOTS_H
9 #include "../autodiff/autodiff.h"
25 template<
unsigned int N>
36 unsigned int iter = 0;
60 TH_MATH_ERROR(
"multi_root_newton", iter, NO_ALGO_CONVERGENCE);
A generic matrix with a fixed number of rows and columns.
Definition: mat.h:132
mat< Type, N, K > inverse() const
Compute the inverse of a generic square matrix.
Definition: mat.h:561
Multidual number algebra for functions of the form .
Definition: multidual.h:26
static void extract(const vec< multidual< N >, N > &v, vec< real, N > &x, mat< real, N, N > &J)
Extract the real vector and dual matrix from a vector of multidual numbers as a vec<real,...
Definition: multidual.h:306
static vec< real, N > extract_real(const vec< multidual< N >, N > &v)
Extract the real vector from a vector of multidual numbers as a vec<real, N>
Definition: multidual.h:273
A statically allocated N-dimensional vector with elements of the given type.
Definition: vec.h:88
Type sqr_norm() const
Compute the square norm of the vector (v * v)
Definition: vec.h:298
#define TH_MATH_ERROR(F_NAME, VALUE, EXCEPTION)
TH_MATH_ERROR is a macro which throws exceptions or modifies errno (depending on which compiling opti...
Definition: error.h:219
Main namespace of the library which contains all functions and objects.
Definition: algebra.h:27
double real
A real number, defined as a floating point type.
Definition: constants.h:188
constexpr real OPTIMIZATION_MINGRAD_TOLERANCE
Default tolerance for gradient descent minimization.
Definition: constants.h:308
constexpr unsigned int OPTIMIZATION_MINGRAD_ITER
Maximum number of iterations for gradient descent minimization.
Definition: constants.h:311
vec< real, N > multiroot_newton(autodiff::dvec_t< N >(*f)(autodiff::dvec_t< N >), vec< real, N > guess=vec< real, N >(0), real tolerance=OPTIMIZATION_MINGRAD_TOLERANCE, unsigned int max_iter=OPTIMIZATION_MINGRAD_ITER)
Approximate the root of a multivariate function using Newton's method with pure Jacobian.
Definition: multi_roots.h:26
dual2 square(dual2 x)
Return the square of a second order dual number.
Definition: dual2_functions.h:23
real nan()
Return a quiet NaN number in floating point representation.
Definition: error.h:54