Skip to content

Commit

Permalink
Merge pull request #809 from pymor/blockoperator-none-blocks
Browse files Browse the repository at this point in the history
Avoid checking in BlockOperators if block is None
  • Loading branch information
pmli committed Nov 6, 2019
2 parents e9b3fe2 + 449e368 commit d4fe828
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/pymor/operators/block.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def __init__(self, blocks):

@property
def H(self):
return self.adjoint_type(np.vectorize(lambda op: op.H if op else None)(self.blocks.T))
return self.adjoint_type(np.vectorize(lambda op: op.H)(self.blocks.T))

def apply(self, U, mu=None):
assert U in self.source
Expand Down Expand Up @@ -102,8 +102,7 @@ def as_range_array(self, mu=None):
def process_row(row, space):
R = space.empty()
for op in row:
if op is not None:
R.append(op.as_range_array(mu))
R.append(op.as_range_array(mu))
return R

subspaces = self.range.subspaces if self.blocked_range else [self.range]
Expand All @@ -115,8 +114,7 @@ def as_source_array(self, mu=None):
def process_col(col, space):
R = space.empty()
for op in col:
if op is not None:
R.append(op.as_source_array(mu))
R.append(op.as_source_array(mu))
return R

subspaces = self.source.subspaces if self.blocked_source else [self.source]
Expand Down

0 comments on commit d4fe828

Please sign in to comment.