Commit 9ebbecf5 by Martin Reinecke

### simplify Energy class

parent 92ff0e59
 ... ... @@ -66,7 +66,6 @@ from .minimization.scipy_minimizer import (ScipyMinimizer, NewtonCG, L_BFGS_B, from .minimization.energy import Energy from .minimization.quadratic_energy import QuadraticEnergy from .minimization.line_energy import LineEnergy from .minimization.energy_sum import EnergySum from .sugar import * from .plotting.plot import plot, plot_finish ... ... @@ -74,11 +73,11 @@ from .plotting.plot import plot, plot_finish from .library.amplitude_model import AmplitudeModel from .library.gaussian_energy import GaussianEnergy from .library.los_response import LOSResponse #from .library.point_sources import PointSources # from .library.point_sources import PointSources from .library.poissonian_energy import PoissonianEnergy from .library.wiener_filter_curvature import WienerFilterCurvature #from .library.correlated_fields import (make_correlated_field, # make_mf_correlated_field) # from .library.correlated_fields import (make_correlated_field, # make_mf_correlated_field) from .library.bernoulli_energy import BernoulliEnergy from . import extra ... ...
 ... ... @@ -135,31 +135,6 @@ class Energy(NiftyMetaBase()): raise TypeError return MetricInversionEnabler(self, controller, preconditioner) def __mul__(self, factor): from .energy_sum import EnergySum if isinstance(factor, (float, int)): return EnergySum.make([self], [factor]) return NotImplemented def __rmul__(self, factor): return self.__mul__(factor) def __add__(self, other): from .energy_sum import EnergySum if isinstance(other, Energy): return EnergySum.make([self, other]) return NotImplemented def __sub__(self, other): from .energy_sum import EnergySum if isinstance(other, Energy): return EnergySum.make([self, other], [1., -1.]) return NotImplemented def __neg__(self): from .energy_sum import EnergySum return EnergySum.make([self], [-1.]) class MetricInversionEnabler(Energy): def __init__(self, ene, controller, preconditioner): ... ...