www.mooseframework.org
BrentsMethod.h
Go to the documentation of this file.
1 /****************************************************************/
2 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
3 /* */
4 /* All contents are licensed under LGPL V2.1 */
5 /* See LICENSE for full restrictions */
6 /****************************************************************/
7 
8 #ifndef BRENTSMETHOD_H
9 #define BRENTSMETHOD_H
10 
11 // MOOSE includes
12 #include "Moose.h"
13 
14 // C++ includes
15 #include <functional>
16 
17 namespace BrentsMethod
18 {
27 void bracket(std::function<Real(Real)> const & f, Real & x1, Real & x2);
28 
38 Real root(std::function<Real(Real)> const & f, Real x1, Real x2, Real tol = 1.0e-12);
39 }
40 
41 #endif // BRENTSMETHOD_H
Real root(std::function< Real(Real)> const &f, Real x1, Real x2, Real tol=1.0e-12)
Finds the root of a function using Brent&#39;s method.
Definition: BrentsMethod.C:58
static const double tol
Definition: XFEMFuncs.h:26
void bracket(std::function< Real(Real)> const &f, Real &x1, Real &x2)
Function to bracket a root of a given function.
Definition: BrentsMethod.C:14