Slight re-design of the `Energy` class
Currently, most energy classes take constructor arguments which allow their curvatures to be inverted. This only makes sense as long as we are not working very much with sums of energies. In this latter case, it doesn't matter if the individual curvatures are invertible or not, we just need to make sure that the summed-up curvature is invertible.
I'd like to propose the following changes:
- All inversion-related functionality is removed from the energy classes we currently have
- the
Energy
base class gets a new methodmake_curvature_invertible()
, which takes anIterationController
and optionally anotherEnergy
that serves as a preconditioner (we need anEnergy
here and not simply aLinearOperator
, since the preconditioning might depend on position). This method returns a newEnergy
object, with invertible curvature. - we add a new class
SamplingEnabledEnergy
, whose constructor takes two energiesprior
andlikelihood
and anIterationController
. It returns an energy object that behaves like the sum of prior and likelihood, and returns a sampling-enabled curvature.