Simplex algorithm. More...
#include <simplex_algorithm.h>
Static Public Member Functions | |
| template<typename T, typename CostFunc, typename ReportFunc> | |
| static bool | simplex_minimize (Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &p, Eigen::Matrix< T, Eigen::Dynamic, 1 > &y, T ftol, T stol, CostFunc &&func, int max_eval, int &neval, int report, ReportFunc &&report_func) |
| template<typename T, typename CostFunc> | |
| static bool | simplex_minimize (Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &p, Eigen::Matrix< T, Eigen::Dynamic, 1 > &y, T ftol, T stol, CostFunc &&func, int max_eval, int &neval) |
Protected Member Functions | |
| SimplexAlgorithm () | |
Simplex algorithm.
Simplex algorithm is an optimization method to solve linear optimization problems.
Definition at line 66 of file simplex_algorithm.h.
|
protected |
Protected constructor to make class non-instantiable.
|
static |
Overload without report function (no reporting).
Definition at line 177 of file simplex_algorithm.h.
|
static |
mne_simplex_fit.c Refactored: mne_simplex_minimize
Minimization with the simplex algorithm. Modified from Numerical Recipes. Supports an optional absolute spatial tolerance (stol) to detect simplex collapse.
| T | Scalar type (float or double). |
| CostFunc | Callable with signature T(const VectorX<T>&). Evaluates the cost at a simplex vertex. |
| ReportFunc | Callable with signature bool(int loop, const VectorX<T>& fitpar, double fval_lo, double fval_hi, double par_diff). |
| [in,out] | p | The initial simplex (npar+1 x npar). On return, row 0 is the best vertex. |
| [in,out] | y | Function values at the vertices. |
| [in] | ftol | Relative convergence tolerance. |
| [in] | stol | Absolute spatial convergence tolerance (0 to disable). |
| [in] | func | The cost function to be evaluated. |
| [in] | max_eval | Maximum number of function evaluations. |
| [out] | neval | Number of function evaluations performed. |
| [in] | report | How often to report (-1 = no reporting). |
| [in] | report_func | The function to be called when reporting (may be nullptr). |
Definition at line 192 of file simplex_algorithm.h.