Numerical Tools  1.0
Numerical tools from SciPy and Numerical Methods in Physics with Python
NumericalTools.Optimize Class Reference

Classes

struct  FsolveInfo
 
struct  SciPyZerosInfo
 

Public Member Functions

delegate double FunctionOneVar (double a)
 
delegate double Function (double a, params object[] args)
 
delegate double [] FsolveFun (double[] x, params object[] args)
 
delegate double [] FsolveFprimeFun (double[] x, params object[] args)
 

Static Public Member Functions

static double BrentQ (Function f, double a, double b, double xtol=_XTOL, double rtol=_RTOL, int maxiter=_MAXITER, bool full_output=false, bool disp=true)
 Wrapper on BrentQ root finder. This version only returns the root and not the stats (full_output is ignored) More...
 
static int FsolveSimple (Minpack.Fcn fun, double[] x0, double[] fvec, double tol)
 Find the root of the function fun. More...
 

Public Attributes

const double _RTOL = 2.220446049250313e-16
 
const double _XTOL = 2.220446049250313e-16
 
const int _MAXITER = 1000
 

Static Public Attributes

static double []
 A partial port of the SciPy fsolve root finder. More...
 

Member Function Documentation

◆ BrentQ()

static double NumericalTools.Optimize.BrentQ ( Function  f,
double  a,
double  b,
double  xtol = _XTOL,
double  rtol = _RTOL,
int  maxiter = _MAXITER,
bool  full_output = false,
bool  disp = true 
)
inlinestatic

Wrapper on BrentQ root finder. This version only returns the root and not the stats (full_output is ignored)

Parameters
f
a
b
xtol
rtol
maxiter
full_output
disp
Returns

◆ FsolveSimple()

static int NumericalTools.Optimize.FsolveSimple ( Minpack.Fcn  fun,
double []  x0,
double []  fvec,
double  tol 
)
inlinestatic

Find the root of the function fun.

Fun may be a single function or a set of functions. For this reason even in the single function case it is an array and must return an array of values.

The signature of the function is: public delegate double[] FsolveFun(double[] x, params object[] args);

This represents a vector of functions for which Fsolve will find values x[] such the function evaluates to zero. For a single variable function use a single entry double array.

NOTE: The root found will be returned in the x0[] parametger

Parameters
funThe vector valued function to find the root of
x0Array of the initial values for starting point for root finding
fvecThe values of the functions at the root found
tolTolerance with which root is to be found.
Returns
(root value is returned via the x0[] parameter)

Member Data Documentation

◆ double

NumericalTools.Optimize.double[]
static

A partial port of the SciPy fsolve root finder.

More commonly called via FsolveSimple()

Parameters
fun
x0
fprime
full_output
col_deriv
xtol
maxfev
factor
args
Returns

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