v2.0.0
Loading...
Searching...
No Matches
simplex_algorithm.h File Reference

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

#include "math_global.h"
#include <Eigen/Core>
Include dependency graph for simplex_algorithm.h:
This graph shows which files directly or indirectly include this file:

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).

Detailed Description

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

SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2026 MNE-CPP Authors

Author
Christoph Dinh chris.nosp@m.toph.nosp@m..dinh.nosp@m.@mne.nosp@m.-cpp..nosp@m.org
Since
2.0.0
Date
March 2026

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.