philsupertramp/game-math
Loading...
Searching...
No Matches
Typedefs | Functions
newton.h File Reference
#include "../utils.h"
#include "gaussSeidel.h"
#include <functional>

Go to the source code of this file.

Typedefs

using Jacobian = std::function< Matrix< double >(const Matrix< double > &)>
 representation of jacobian More...
 
using LinearEquation = std::function< Matrix< double >(const Matrix< double > &)>
 representation of linear equation More...
 

Functions

std::pair< Matrix< double >, int > newton (const LinearEquation &f, const Jacobian &Df, const Matrix< double > &x0, double TOL, int maxIter)
 

Detailed Description

Implements newton-method to find roots

Requires:

Typedef Documentation

◆ Jacobian

using Jacobian = std::function<Matrix<double>(const Matrix<double>&)>

representation of jacobian

◆ LinearEquation

using LinearEquation = std::function<Matrix<double>(const Matrix<double>&)>

representation of linear equation

Function Documentation

◆ newton()

std::pair< Matrix< double >, int > newton ( const LinearEquation f,
const Jacobian Df,
const Matrix< double > &  x0,
double  TOL,
int  maxIter 
)

newton method to find roots of given function f

Parameters
flinear equation
Dfderivative of f
x0start value
TOLdesired tolerance of the method
maxItermaximum iterations for the method
Returns
approximated values paired with required number iterations for given tolerance
Examples
numerics/lin_alg/TestNewton.cpp.