Adapt the mixing factor alpha based on energy gain.
preTrunc | energy prior to truncation, after solution |
postTrunc | energy after truncation |
Also uses conf.lastEnergy for the energy before the truncation.
The idea is that we want to keep the energy loss during truncation at some 30% of the energy gain during optimisation and adapt conf.alpha accordingly, as it controls the strength of the perturbation.
References syten::abs(), std::isnan(), std::max(), and std::min().