Commit bbb24ee2 authored by Vincent Eberle's avatar Vincent Eberle
Browse files

cosmnetics

parent 2da37399
Pipeline #67719 passed with stages
in 15 minutes and 24 seconds
......@@ -99,18 +99,17 @@ class ScalingOperator(EndomorphicOperator):
std=self._get_fct(from_inverse), dtype=dtype)
def __call__(self, other):
res = EndomorphicOperator.__call__(self, other)
if np.isreal(self._factor) and self._factor >= 0:
from ..linearization import Linearization
if isinstance(other, Linearization):
res = EndomorphicOperator.__call__(self, other)
if other.metric is not None:
from .sandwich_operator import SandwichOperator
sqrt_fac = np.sqrt(self._factor)
newop = ScalingOperator(other.metric.domain, sqrt_fac)
met = SandwichOperator.make(newop, other.metric)
res = res.add_metric(met)
return res
return EndomorphicOperator.__call__(self, other)
return res
def __repr__(self):
return "ScalingOperator ({})".format(self._factor)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment