Commit ecc96428 authored by Gordian Edenhofer's avatar Gordian Edenhofer
Browse files

correlated_fields.py: Use ScalingOperator

Where applicable, use a ScalingOperator instead of a DiagonalOperator.
parent ff7dfaa8
...@@ -69,9 +69,11 @@ def _normal(mean, sig, key, N=0): ...@@ -69,9 +69,11 @@ def _normal(mean, sig, key, N=0):
if N == 0: if N == 0:
domain = DomainTuple.scalar_domain() domain = DomainTuple.scalar_domain()
mean, sig = np.asfarray(mean), np.asfarray(sig) mean, sig = np.asfarray(mean), np.asfarray(sig)
else: return Adder(makeField(domain, mean)) @ (
domain = UnstructuredDomain(N) sig * ducktape(domain, None, key))
mean, sig = (_reshaper(param, N) for param in (mean, sig))
domain = UnstructuredDomain(N)
mean, sig = (_reshaper(param, N) for param in (mean, sig))
return Adder(makeField(domain, mean)) @ (DiagonalOperator( return Adder(makeField(domain, mean)) @ (DiagonalOperator(
makeField(domain, sig)) @ ducktape(domain, None, key)) makeField(domain, sig)) @ ducktape(domain, None, key))
......
Supports Markdown
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