Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BlockOperator and BlockDiagonalOperator #215

Merged
merged 11 commits into from Feb 19, 2016
Merged

BlockOperator and BlockDiagonalOperator #215

merged 11 commits into from Feb 19, 2016

Conversation

pmli
Copy link
Member

@pmli pmli commented Feb 2, 2016

Code: src/pymor/playground/block.py
Tests: src/pymortests/block.py

@sdrave sdrave mentioned this pull request Feb 13, 2016
self.num_source_blocks = len(source_types)
self.num_range_blocks = len(range_types)
self.linear = all(op.linear for op in self._operators())
self._is_diagonal = (all(block is None if i != j else True for (i, j), block in np.ndenumerate(self._blocks))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is_diagonal is not used

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. Should it be used somehow or can it be removed?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess I would just remove it...

@ftalbrecht
Copy link
Contributor

Sorry for being so late. I left a few notes, please take a look. Apart from that: looks good to me!

@sdrave sdrave added this to the 0.4 milestone Feb 18, 2016
@sdrave
Copy link
Member

sdrave commented Feb 18, 2016

Looks good to me! When merging I will only update the copyright notice and remove the import from the __init__.py (we have the policy of not importing subpackages). I believe we could also directly move this from the playground to pymor.operators.block?

@ftalbrecht
Copy link
Contributor

ftalbrecht commented Feb 18, 2016 via email

@sdrave sdrave merged commit 20c61fa into pymor:master Feb 19, 2016
@sdrave
Copy link
Member

sdrave commented Feb 19, 2016

Hi @pmli, thank you very much for your contribution! Your code is now in master and I have added an attribution to AUTHORS.md.

By adding fixtures for BlockOperator and BlockDiagonalOperator to our testing framework, I discovered a small bug in your BlockDiagonalOperator.apply_inverse_adjoint implementation in the case when scalar products are present: The inverse adjoint operator maps from source to range, so the source_product needs to be applied first, not the range_product. I simplified the code by calling the default implementation which takes care of the scalar products, so only the no-product case has to be implemented.

@pmli pmli deleted the block-operator2 branch March 2, 2016 08:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants