Commit f6579f8
committed
refactor: modernize fit2x - own L-BFGS, remove LabVIEW layer and ALGLIB, BSD-3 SPDX
Optimizer:
- Replace the bundled FORTRAN-derived L-BFGS (Nocedal/ALGLIB translation,
non-OSI citeware license) and the entire thirdparty/alglib tree (compiled
wholesale but used only for its array type) with a self-contained,
header-only, std-only L-BFGS in include/i_lbfgs.h (BSD-3, ~150 lines:
two-loop recursion, Armijo backtracking, central-difference gradients).
The bfgs class interface (target function, fixed-parameter masks, eps and
iteration control, minimize info codes) is unchanged, so DecayFit23-26
and the 2D Gaussian image localization work without call-site changes.
fit2x cleanup:
- Remove the LabView-heritage interface: LVI32Array, LVDoubleArray, MParam,
CreateMParam and CreateLV*Array are gone. The fits now use DecayFitData,
a plain std::vector container (Jordi format sizing preserved) that maps
directly to numpy via SWIG. The x/fixed parameter array layouts of
DecayFitNN::fit/modelf/targetf are unchanged.
- Fix an uninitialized stack read in DecayFit25::correct_input (gamma was
read from xm[1] before ever being written), which made fit25 results
depend on the process memory layout. Fit results are now reproducible
across processes.
- Make all fit-internal static state thread_local.
- New one-call convenience API: tttrlib.fit23/fit24/fit25/fit26 functions
with keyword arguments, sensible defaults and dict results; the
Fit23-Fit26 wrapper classes stay unchanged.
Licensing:
- Consistent BSD-3-Clause: fix the stray MIT SPDX tag in DecayFit.h and
add SPDX-License-Identifier: BSD-3-Clause to all project sources
(include/, src/, ext/python/). No third-party optimizer code remains.
Verified: fit model functions bit-identical; fit quality (2I*) equal or
better than the previous optimizer on a multi-start grid; full test suite
passes (616); fit23 throughput ~15k fits/s.1 parent cbbf554 commit f6579f8
158 files changed
Lines changed: 944 additions & 11746 deletions
File tree
- examples/fluorescence_decay
- ext
- python
- include
- src
- test
- thirdparty
- alglib
- lbfgs
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
194 | 194 | | |
195 | 195 | | |
196 | 196 | | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | 197 | | |
206 | 198 | | |
207 | 199 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
61 | | - | |
| 60 | + | |
| 61 | + | |
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
1 | 2 | | |
2 | 3 | | |
3 | 4 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
1 | 2 | | |
2 | 3 | | |
3 | 4 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
1 | 2 | | |
2 | 3 | | |
3 | 4 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
1 | 2 | | |
2 | 3 | | |
3 | 4 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
1 | 2 | | |
2 | 3 | | |
3 | 4 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
1 | 2 | | |
2 | 3 | | |
3 | 4 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
1 | 2 | | |
2 | 3 | | |
3 | 4 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
1 | 2 | | |
2 | 3 | | |
3 | 4 | | |
| |||
0 commit comments