DUNE: Uniform Navigational Environment  2019.02.0
DUNE::Math::Optimization Class Reference

Public Types

enum  Result { OPT_CONVERGED, OPT_MAX_ITER, OPT_NOT_UNIMODAL, OPT_INVALID_ARGUMENTS }
 
typedef double math_fun_t (double, const void *)
 

Static Public Member Functions

static Result minimize (math_fun_t *f, const void *args, double a, double b, double tol, unsigned max_iter, double *min_out, double *tol_out)
 
static Result maximize (math_fun_t *f, const void *args, double a, double b, double tol, unsigned max_iter, double *max_out, double *tol_out)
 

Member Typedef Documentation

typedef double DUNE::Math::Optimization::math_fun_t(double, const void *)

Typedef for handles of functions to optimize.

Member Enumeration Documentation

Return code enumeration.

Enumerator
OPT_CONVERGED 

Converged.

OPT_MAX_ITER 

Did not converge.

OPT_NOT_UNIMODAL 

Function was found not be unimodal.

OPT_INVALID_ARGUMENTS 

Invalid arguments.

Member Function Documentation

Optimization::Result DUNE::Math::Optimization::maximize ( math_fun_t f,
const void *  args,
double  a,
double  b,
double  tol,
unsigned  max_iter,
double *  max_out,
double *  tol_out 
)
static

Maximize a function.

Parameters
fFunction to maximize.
argsFunction parameters.
aBeginning of interval for maximization.
bEnd of interval for maximization.
tolMax. absolute error.
max_iterMax. allowed iterations or 0 for unbounded.
max_outFound maximum.
tol_outFinal absolute error.

References minimize().

Optimization::Result DUNE::Math::Optimization::minimize ( math_fun_t f,
const void *  args,
double  a,
double  b,
double  tol,
unsigned  max_iter,
double *  min_out,
double *  tol_out 
)
static

Minimize a function.

Parameters
fFunction to minimize.
argsFunction parameters.
aBeginning of interval for minimization.
bEnd of interval for minimization.
tolMax. absolute error.
max_iterMax. allowed iterations or 0 for unbounded.
min_outFound minimum.
tol_outFinal absolute error.

References OPT_CONVERGED, OPT_INVALID_ARGUMENTS, OPT_MAX_ITER, and OPT_NOT_UNIMODAL.

Referenced by maximize().

Collaboration diagram for DUNE::Math::Optimization:
Collaboration graph