Commit d352f076 authored by Martin Reinecke's avatar Martin Reinecke
Browse files

Merge branch 'bug_fix' into 'operator_spectra'

Changes in BlockDiagonalOperator and LogRGSpace

See merge request !344
parents d171464e f666c125
Pipeline #61042 passed with stages
in 8 minutes and 55 seconds
......@@ -96,7 +96,7 @@ class LogRGSpace(StructuredDomain):
The parter domain
codomain_bindistances = 1./(self.bindistances*self.shape)
return LogRGSpace(self.shape, codomain_bindistances, self._t_0, True)
return LogRGSpace(self.shape, codomain_bindistances, self._t_0, not self.harmonic)
def get_k_length_array(self):
"""Generates array of distances to origin of the space.
......@@ -30,7 +30,7 @@ class BlockDiagonalOperator(EndomorphicOperator):
Domain and target of the operator.
operators : dict
Dictionary with subdomain names as keys and :class:`LinearOperator` s
as items.
as items. Any missing item will be treated as unity operator.
def __init__(self, domain, operators):
if not isinstance(domain, MultiDomain):
......@@ -44,13 +44,17 @@ class BlockDiagonalOperator(EndomorphicOperator):
def apply(self, x, mode):
self._check_input(x, mode)
val = tuple(op.apply(v, mode=mode) if op is not None else None
val = tuple(op.apply(v, mode=mode) if op is not None else v
for op, v in zip(self._ops, x.values()))
return MultiField(self._domain, val)
def draw_sample(self, from_inverse=False, dtype=np.float64):
val = tuple(op.draw_sample(from_inverse, dtype)
if op is not None else None for op in self._ops)
from ..sugar import from_random
val = tuple(
op.draw_sample(from_inverse, dtype)
if op is not None
else from_random('normal', self._domain[key], dtype=dtype)
for op, key in zip(self._ops, self._domain.keys()))
return MultiField(self._domain, val)
def _combine_chain(self, op):
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