Skip to content

Simplify semantics of assemble_lincomb / fix #1276#1296

Merged
sdrave merged 5 commits into
mainfrom
inf_recursion_lincomb
Apr 28, 2021
Merged

Simplify semantics of assemble_lincomb / fix #1276#1296
sdrave merged 5 commits into
mainfrom
inf_recursion_lincomb

Conversation

@sdrave

@sdrave sdrave commented Apr 23, 2021

Copy link
Copy Markdown
Member

Fixes #1276.

@sdrave sdrave added pr:change Change in existing functionality pr:fix Fixes a bug labels Apr 23, 2021
@sdrave sdrave added this to the 2021.1 milestone Apr 23, 2021
@sdrave sdrave requested a review from pmli April 23, 2021 09:02
@codecov

codecov Bot commented Apr 23, 2021

Copy link
Copy Markdown

Codecov Report

Merging #1296 (e160ca0) into main (5bd99d2) will decrease coverage by 0.04%.
The diff coverage is 85.50%.

Impacted Files Coverage Δ
src/pymor/reductors/neural_network.py 87.86% <83.05%> (-4.49%) ⬇️
src/pymor/algorithms/lincomb.py 80.52% <100.00%> (-0.31%) ⬇️
src/pymor/models/neural_network.py 94.33% <100.00%> (ø)
src/pymor/operators/constructions.py 89.09% <100.00%> (+0.17%) ⬆️
src/pymortests/operators.py 98.13% <100.00%> (+0.04%) ⬆️
src/pymortests/mpi_run_demo_tests.py 84.61% <0.00%> (-5.13%) ⬇️
src/pymor/bindings/ngsolve.py 78.37% <0.00%> (-0.68%) ⬇️
src/pymortests/vectorarray.py 92.26% <0.00%> (-0.12%) ⬇️
src/pymor/algorithms/genericsolvers.py 78.96% <0.00%> (+0.20%) ⬆️

if op:
# To avoid infinite recursions, only use the result if at least one of the following
# is true:
# - The operator is parametric, so the the result of assemble *must* be a different,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
# - The operator is parametric, so the the result of assemble *must* be a different,
# - The operator is parametric, so the result of assemble *must* be a different,

# - One of self.operators changed by calling 'assemble' on it.
# - The result of assemble_lincomb is of a different type than the original operator.
# - assemble_lincomb could simplify the list of assembled operators,
# which we define to be the case when the number of operators has ben reduced.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
# which we define to be the case when the number of operators has ben reduced.
# which we define to be the case when the number of operators has been reduced.

@sdrave sdrave merged commit b536799 into main Apr 28, 2021
@sdrave sdrave deleted the inf_recursion_lincomb branch April 28, 2021 09:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr:change Change in existing functionality pr:fix Fixes a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BlockOperator.apply_inverse infinite recursion with a special LincombOperator as a block

3 participants