ratt-ru / QuartiCal

CubiCal, but with greater power.
MIT License
8 stars 4 forks source link

On-the-fly residuals #169

Closed JSKenyon closed 2 years ago

JSKenyon commented 2 years ago

This PR removes the allocation of a residual array in the solvers. Instead, the residuals are calculated on-the-fly using the left and right hand operators which themselves were already being computed in compute_jhj_jhr. This saves on memory but can also save on flops in chains of multiple terms.

This PR also deprecates and removes the approx_complex solver. Whist this was likely still slightly faster than the non-approximate (i.e. correctly weighted) complex solver, it has diverged too far from the other solvers to be easily maintained. This will likely reduce confusion in the long run.

Finally, this PR also fixes a long standing out-of-bounds bug in the phase and amplitude only solvers.

Edit: Tests will now use parallelism in an effort to catch race/bounds errors.