KratosMultiphysics
KRATOS Multiphysics (Kratos) is a framework for building parallel, multi-disciplinary simulation software, aiming at modularity, extensibility, and high performance. Kratos is written in C++, and counts with an extensive Python interface.
Static Public Member Functions | List of all members
Kratos::BrentIteration Class Reference

#include <brent_iteration.h>

Collaboration diagram for Kratos::BrentIteration:

Static Public Member Functions

template<typename func_t >
static double FindRoot (func_t Function, double Guess1, double Guess2, double Tolerance, int MaximumIterations)
 

Detailed Description

Find a root of a one-variable function using Brent's algorithm. This is a C++ implementation of the algorithm in Press, Teukolsky, Vetterling, Flannery. Numerical Recipes in Fortran (2nd Edition).

Member Function Documentation

◆ FindRoot()

template<typename func_t >
static double Kratos::BrentIteration::FindRoot ( func_t  Function,
double  Guess1,
double  Guess2,
double  Tolerance,
int  MaximumIterations 
)
inlinestatic

Find a root of Funtion in the range defined by Guess1 and Guess2. Function is something that takes a double and returns a double. Note that Guess1 and Guess2 must be on opposite sides of the root, that is Function(Guess1)*Function(Guess2) < 0.0.


The documentation for this class was generated from the following file: