Header-only Nelder–Mead simplex minimiser with pluggable cost and report callables. More...


Go to the source code of this file.
Classes | |
| class | UTILSLIB::SimplexAlgorithm |
| Header-only Nelder–Mead simplex minimiser with templated cost and report functors. More... | |
Namespaces | |
| namespace | UTILSLIB |
| Shared utilities (I/O helpers, spectral analysis, layout management, warp algorithms). | |
Header-only Nelder–Mead simplex minimiser with pluggable cost and report callables.
SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2026 MNE-CPP Authors
Nelder–Mead is a derivative-free direct-search minimiser that deforms a simplex of n+1 vertices in R^n using reflection, expansion, contraction and shrink moves driven entirely by function value comparisons. mne-cpp uses it for dipole-fit residual minimisation (FWDLIB) and for sphere fitting (UTILSLIB::Sphere) where the objective is noisy and the gradient is either unavailable or expensive.
The implementation lives entirely in this header because it is templated on the scalar type and on the cost / report functors (zero runtime cost over a hand-written loop). Termination uses both a relative function-value tolerance ftol and an optional absolute spatial tolerance stol that detects simplex collapse, plus a hard cap on function evaluations. A reporting callback can be provided to stream per-iteration progress without coupling the solver to any UI or logging facility.
Reference: Nelder & Mead (1965) "A simplex method for function
minimization"; refactored from the mne_simplex_minimize routine in mne_simplex_fit.c.
Definition in file simplex_algorithm.h.